Skip to content

Rewrite the backend development pages - #112

Open
DavidLambauer wants to merge 4 commits into
docs/rewrite-api-testing-deploymentfrom
docs/rewrite-backend-pages
Open

DavidLambauer wants to merge 4 commits into
docs/rewrite-api-testing-deploymentfrom
docs/rewrite-backend-pages

Conversation

@DavidLambauer

@DavidLambauer DavidLambauer commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #111. Merge #111 first; GitHub then retargets this PR to main. The diff below only shows the backend changes.

Rewrites the remaining Backend Development pages against the Mage-OS 4.0.0 code. There is one commit per group.

Database, admin, CLI, logging

  • Database access and ORM: every SQL sample used columns that don't exist (catalog_product_entity has no name or price). The page now covers a model, resource model, collection and repository, SQL with bound values against real tables, transactions and a data patch. The ObjectManager and the deprecated save()/load() are gone.
  • Working with Adminhtml: the deprecated grid and form containers are replaced with routes, controllers with ADMIN_RESOURCE, ACL, menu, system.xml, form keys and UI component grids. The old controller never checked its ACL resource.
  • CLI commands: the cache:clean/cache:flush semantics and the commands with missing arguments are corrected. It also shows how to write and register a command on Symfony Console 7.4.
  • Logging: which file gets which levels, and a custom log file through di.xml virtual types.

Events, plugins, cron, indexers

  • Events and observers (observers merged into events): the old pages
    • dispatched customer_register_success again, so every observer ran twice;
    • called getName() on a customer;
    • used a sequence attribute that events.xsd doesn't have.
  • Plugins:
    • The around plugin dropped arguments, so two-argument methods threw ArgumentCountError.
    • The execution order is now described as the interceptor implements it.
  • Cron jobs:
    • cron:status doesn't exist; the page now queries cron_schedule instead.
    • The job's XML and class now match.
    • A custom group needs cron_groups.xml.
  • Indexers:
    • The indexer.xml sample used invalid elements, and set-mode used a mode that doesn't exist.
    • The page now lists all 9 indexer:* commands, mview.xml and a custom indexer.

Cache, search, email, i18n

  • Cache management: the old page used a --type option that doesn't exist, listed cache types that don't exist, and stored objects without serializing them. The page now lists the 16 real cache types (including compiled_plugins) and covers tags, a custom cache type and FPC invalidation.
  • Search: OpenSearch, not Elasticsearch. The invented classes and the invalid search_request.xml are gone.
  • Email templates: email_templates.xml, the directives that exist in 4.0.0, theme overrides from vendor/mage-os, and TransportBuilder.
  • i18n: i18n:collect-phrases/i18n:pack, language packages, JavaScript translations and override order.

All XML samples validate against the 4.0.0 XSD files, and all PHP samples pass php -l on PHP 8.4. Every sample and command was then run on a Mage-OS 4.0.0 store (Warden), and the pages were corrected where the behavior differed. The XML samples use the same module, ids and ACL resources as the reference pages in #109.

Follow-up once #109 is merged: link crontab_xml from the cron jobs page. It isn't linked yet, because that slug only exists after #109.

Merge mage-os/devdocs-website#74 first: this pull request removes pages, and until that change is live the website answers a request for a removed page with a 500. #151 adds the redirects to the pages that replace them.

Merge order and notes for reviewers: #115.

🤖 Generated with Claude Code

DavidLambauer and others added 3 commits November 28, 2026 17:29
- Database access and ORM: every SQL sample queried columns that
  don't exist (catalog_product_entity has no name or price; products
  are EAV), and the ORM part used the ObjectManager and the deprecated
  save()/load(). Show a model, resource model, collection and
  repository for one entity, SQL with bound values against real
  tables, transactions and a data patch.
- Working with Adminhtml: replace the deprecated grid and form
  container blocks with admin routes, controllers with ADMIN_RESOURCE,
  acl.xml, menu.xml, system.xml, form keys and UI component grids. The
  old controller never checked its ACL resource.
- CLI commands: correct cache:clean vs cache:flush and the commands
  that lacked arguments, and show how to write and register your own
  command on Symfony Console 7.4.
- Logging: which file gets which levels, and a custom log file with
  virtual types instead of generic logging theory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Events and observers: one page instead of two near-copies. The old
  pages re-dispatched customer_register_success (running every
  observer twice), called getName() on a customer, and used a
  sequence attribute that events.xsd doesn't have. Use real 4.0.0
  events and the data they pass.
- Plugins: the around plugin dropped arguments, so two-argument
  methods threw ArgumentCountError. Add the execution order as the
  interceptor implements it, disabling, area di.xml and what can't be
  intercepted.
- Cron jobs: there is no cron:status command, the XML pointed to a
  class the page didn't define, and a custom group never runs unless
  cron_groups.xml declares it.
- Indexers: indexer.xml used elements the schema rejects and
  set-mode used a mode that doesn't exist. Document every indexer:*
  command of 4.0.0, mview.xml and a custom indexer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Cache management: there is no --type option, page_cache, metadata
  and customer aren't cache types, Tag\Resolver has no invalidate(),
  and objects were cached without serializing them. List the 15 cache
  types of 4.0.0 and show CacheInterface with a serializer and tags,
  a custom cache type and full-page cache invalidation.
- Search: OpenSearch is the default engine, not Elasticsearch, and
  the page invented classes and an invalid search_request.xml. Cover
  the connection settings, the attribute settings that decide what is
  searchable, search terms, synonyms and reindexing.
- Email templates: declare templates in email_templates.xml, use the
  directives 4.0.0 supports ({{for x in y}}...{{/for}}), override core
  templates from vendor/mage-os in a theme, and send mail with
  TransportBuilder.
- i18n: add collect-phrases and pack, language packages, JavaScript
  translations and the order in which translations override each other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every sample module, command, cron run, changelog, Varnish purge and
email on these pages was run against a Mage-OS 4.0.0 store.
Corrections:

- Plugins: Mage-OS compiles plugins into generated code
  (creatuity/magento2-interceptors), so new plugins only run after
  generated/ is cleared. dev:di:info also lists disabled plugins.
- Logging: a logger based on Magento\Framework\Logger\Monolog
  inherits the core handlers and writes to system.log too; the sample
  now uses Monolog\Logger.
- Adminhtml: a POST without a form key redirects silently; menu
  entries also need the parent's ACL resource; refused roles get 403.
- CLI: cache:flush only deletes this store's keys, config:set cleans
  the config cache itself, module:uninstall --non-composer only
  reverts data patches.
- Cache: 16 cache types, including compiled_plugins.
- Search: synonyms need a catalogsearch_fulltext reindex.
- i18n: CSV changes need cache:clean translate layout full_page;
  i18n:pack keeps only the last of duplicate translations.
- Email: strict mode never calls getters such as getCustomerName().
- Cron and indexers: separate-process groups, realtime mode marking an
  indexer invalid, and updated_at-only changes not reaching the
  changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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