Skip to content

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Jan 15, 2026

Motivation

  • Centralize all PrettyBlocks import/export logic into a single service to improve separation of concerns and make the module class slimmer.
  • Reuse existing media handling helpers when rehydrating blocks during import and ensure hook selection remains accurate (only hooks with data are listed).
  • Make media resolution helper available to the new service to correctly download/relocate remote images during import.

Description

  • Added a new service src/Service/EverblockPrettyBlocksImportExport.php that implements exportPrettyblocks(), importPrettyblocks(), getPrettyblocksHookOptions() and supporting helpers to prepare state payloads and move/download media files.
  • Updated everblock.php to call the new service for export/import submissions and to obtain hook options for the configuration form, replacing the previous inline import/export methods with calls to EverblockPrettyBlocksImportExport.
  • Made EverblockTools::urlToFilePath public (public static) so the new import/export service can reuse media download/resolution logic from src/Service/EverblockTools.php.
  • Kept export payload format unchanged and preserved URL replacement, state normalization and WebP conversion behavior when moving media into _PS_IMG_DIR_/cms/prettyblocks/.

Testing

  • No automated tests were executed for this change.

Codex Task

@CySSoO CySSoO merged commit 8221db3 into master Jan 15, 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