Skip to content

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Jan 12, 2026

Motivation

  • Remove the upgrade/version check wiring so the module no longer attempts to fetch or display an upgrade flag at runtime.
  • Eliminate UI and controller references to the display_upgrade flag to avoid calling the removed check.
  • Keep and integrate a dedicated PrettyBlocks admin interface to manage external prettyblocks data from the back office.
  • Ensure PrettyBlocks UI and hooks are only enabled when the external prettyblocks module is present.

Description

  • Removed the checkLatestEverModuleVersion method and all display_upgrade assignments and usages in everblock.php and admin controllers so the upgrade check is no longer executed.
  • Removed the upgrade card from the shared admin template views/templates/admin/configure.tpl so the upgrade UI block is no longer rendered.
  • Added a new admin controller controllers/admin/AdminEverBlockPrettyblockController.php that implements listing, delete, duplication, bulk delete, and duplication between shops and languages for PrettyBlocks entries.
  • Added hasPrettyblocksModule() in everblock.php and wired conditional tab install/uninstall, conditional hook registration, and added AdminEverBlockPrettyblockController to the admin media registration list in hookActionAdminControllerSetMedia so PrettyBlocks features are only active when available.

Testing

  • No automated tests were executed for these changes.

Codex Task

### Motivation
- Provide a back-office management UI for PrettyBlocks entries when the external `prettyblocks` module is present.
- Allow admins to list PrettyBlocks entries and perform actions such as delete and duplicate from the Everblock configuration area.
- Offer helpers to convert PrettyBlocks between shops and between languages to simplify migration tasks.
- Keep behaviour safe if the `prettyblocks` module or its DB schema is not present by detecting availability and schema at runtime.

### Description
- Added `controllers/admin/AdminEverBlockPrettyblockController.php` which detects the `prettyblocks` table schema at runtime and exposes a list with actions for `delete`, `duplicate`, bulk delete and conversion forms; it implements `renderConversionForms`, `processConvertShop`, `processConvertLang`, and `duplicatePrettyblock` logic.
- Register the new admin tab `AdminEverBlockPrettyblock` conditionally during install/uninstall via a new helper `hasPrettyblocksModule()` added to `everblock.php`, and remove the tab during uninstall if present.
- Centralised PrettyBlocks availability checks by replacing repeated inline checks with the new `hasPrettyblocksModule()` method and used it for hook registration paths (`actionRegisterBlock`, `beforeRenderingEverblock*`).
- Integrated the new controller into admin media loading by adding `AdminEverBlockPrettyblockController` to the module controllers list in `hookActionAdminControllerSetMedia` so admin assets are loaded for the controller.

### Testing
- No automated tests were executed for these changes (no CI/unit tests run as part of this rollout).
@CySSoO CySSoO merged commit 166d0b5 into master Jan 12, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants