Skip to content

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Jan 15, 2026

Motivation

  • The prettyblocks table may store hook identifiers in the zone_name column which represents hook names rather than numeric id_hook values.
  • Admin listing and import/export logic must therefore resolve zone_name against the hook table and warn or reject entries when the referenced hook does not exist.
  • This prevents showing incorrect hook information and avoids importing blocks bound to non-existent hooks.

Description

  • In controllers/admin/AdminEverBlockPrettyblockController.php add support for zone_name by selecting COALESCE(h.name, a.zone_name) AS hook_name, joining the hook table on h.name = a.zone_name, and setting the correct hookFilterKey, and add notifyMissingHooksForZoneName() to warn about missing hooks.
  • In src/Service/EverblockPrettyBlocksImportExport.php extend resolvePrettyblocksHookField() to detect zone_name and prefer populated zone_name values, and add hookExistsByName() helper.
  • Update exportPrettyblocks() to validate the selected hook exists and use a dynamic WHERE clause based on the resolved hook column, and update getPrettyblocksHookOptions() to only return hooks that exist in the hook table.
  • Update importPrettyblocks() to skip rows whose hook/zone_name value has no matching hook record and collect/report the list of skipped hook names.

Testing

  • No automated tests were executed for this change.

Codex Task

@CySSoO CySSoO merged commit 0286ae2 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