Skip to content

Hyva cms support - #11

Merged
gregor-RW merged 20 commits into
mainfrom
hyva-cms-support
Aug 16, 2026
Merged

gregor-RW merged 20 commits into
mainfrom
hyva-cms-support

Conversation

@gregor-RW

Copy link
Copy Markdown
Contributor

No description provided.

Gregor Pollak added 20 commits August 16, 2026 12:55
The export usage block listed an --importAll flag that command does not
have, neither block listed --hyva-cms, and the import block had the wrong
syntax for --store. The folder structure predated the store code suffix.
A disabled CMS block or menu renders as nothing exactly like a missing one,
so the existence check has to filter on is_active for every reference kind
rather than for instance components alone. CmsBlockRenderer::renderBlock()
returns early when is_active is false, and the menu widget only renders
inside if ($menu && $menu->isActive()).
…o write

isAvailable() guarded only PageRepositoryInterface while both classes also
resolve JitCssRepository, and the writer resolves Provider as well. Those
live in Hyva_CmsLiveviewEditor rather than Hyva_CmsMagento, so one check
covered them only while the two ship inside the same package.

writeFlags() also saved the entity even when the payload carried neither
flag, which bumped update_time for nothing.
Every Hyva class was resolved through the object manager at each call site.
They are now resolved once in the constructor, guarded on all of them being
present, and used as ordinary properties afterwards. isAvailable() reports
on the resolved property rather than probing a single unrelated interface.

The docblocks had grown into prose. Trimmed to what the code cannot state
itself: why the object manager is there, the two load bearing write orders,
and the array shapes.
Constructor parameters carry the full namespace so a dependency is readable
in a diff without scrolling to the imports. The two import/export services
already followed this, the new Hyva classes did not. Drops the use
statements that became unreferenced.
A CMS block identifier may contain ".html", and the block export writes the
identifier into the filename verbatim, unlike the page export which converts
it to "_html" first. Replacing every occurrence pointed at a file that does
not exist, so the Hyva content for such a block was skipped silently while
its native content imported fine.

The pre-existing .json derivation carries the same flaw and is left alone.
Composer refuses to install packages carrying security advisories, and the
pinned 2.4.5-p5 requires web-token/jwt-framework ^v2.2.7, every version of
which is flagged. The job died in composer install before any test ran.
2.4.7 moved to a jwt-framework major that is not affected, and it needs
PHP 8.2 or 8.3, so the action variant moves with it.
…PHP 8.4

Three files. ReferenceCollectorTest covers the walker, which is pure logic
and needs nothing installed. HyvaCmsAbsentTest proves the degraded path
that the public CI install actually exercises: the flag stays inert, the
reader and writer return null rather than fatal, and the export with the
flag on is byte identical to the export with it off. HyvaCmsPresentTest
covers the real path and skips where Hyva is absent, since Hyva Commerce
is licensed and CI cannot pull it. It pins the two write orderings, both
of which are silent when reversed.

2.4.8-p5 is the current release and allows PHP 8.2 to 8.4, so the action
variant moves to 8.4 to match what this module is deployed onto.
Magento 2.4.8 ships an elasticsearch-php that refuses any server not
identifying as Elasticsearch 7.14 or newer, so setup:install died on the
pinned 7.8 image with "the server is not Elasticsearch".
markTestSkipped() throws inside setUp before the typed properties are
assigned, and PHPUnit then reads them, which aborted the run with
"must not be accessed before initialization" before the summary printed.
@gregor-RW
gregor-RW merged commit e657a08 into main Aug 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant