Created
August 21, 2024 07:53
-
-
Save mklooss/781f70a025cce24eee6845ee115ddace to your computer and use it in GitHub Desktop.
Create Magento2 CMS Page URLs if Missing, idk why, but we missed some
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO url_rewrite | |
SELECT | |
NULL AS url_rewrite_id, | |
'cms-page' AS entity_type, | |
cp.page_id AS entity_id, | |
cp.identifier AS request_path, | |
CONCAT('cms/page/view/page_id/', cp.page_id) AS target_path, | |
0 AS redirect_type, | |
1 AS store_id, | |
NULL as description, | |
1 AS is_autogenerated, | |
NULL as metadata | |
FROM cms_page AS cp | |
WHERE | |
cp.is_active = 1 AND cp.identifier != 'no-route' AND cp.identifier != 'home' | |
ON DUPLICATE KEY UPDATE metadata = NULL; | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment