Skip to content

Commit e995d9d

Browse files
alfredangclaude
andcommitted
fix(megamenu): repoint Google-form links by entity_id (257 no-oped on prod)
Migration 257 looked up categories by url_key at store_id=0; on prod the url_key and the Google umm_cat_target live at store_id=1, so 7 menu items were skipped (Regional Partnership, Course Feedback, Hiring, In-House, Refund, Customised, Assessment Appeal). Redo by hard-coded entity_id (matches prod) and delete non-zero-store overrides so the store-1 Google value cannot win. Relabel category 180 to 'Regional Franchisee'. Run a reindex after deploy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 955b1bc commit e995d9d

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
-- 262: Fix Enquiries mega-menu Google links by ENTITY_ID (257 used a store-0
2+
-- url_key lookup that no-oped on prod where url_key/target live at store 1).
3+
-- Sets umm_cat_target to the on-site page at store 0 and removes any
4+
-- non-zero-store override so the Google value cannot win. Also relabels the
5+
-- franchise category to 'Regional Franchisee'. Reindex after applying.
6+
7+
SET @a_tg := (SELECT attribute_id FROM eav_attribute WHERE entity_type_id=3 AND attribute_code='umm_cat_target');
8+
SET @a_lbl := (SELECT attribute_id FROM eav_attribute WHERE entity_type_id=3 AND attribute_code='umm_cat_label');
9+
SET @a_nm := (SELECT attribute_id FROM eav_attribute WHERE entity_type_id=3 AND attribute_code='name');
10+
11+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=114 AND store_id<>0;
12+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,114,'/trainer-application.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
13+
14+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=115 AND store_id<>0;
15+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,115,'/in-house-training.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
16+
17+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=117 AND store_id<>0;
18+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,117,'/course-feedback.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
19+
20+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=173 AND store_id<>0;
21+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,173,'/extract-cpf-contribution.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
22+
23+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=180 AND store_id<>0;
24+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,180,'/franchising-application.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
25+
26+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=254 AND store_id<>0;
27+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,254,'/in-house-training.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
28+
29+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=255 AND store_id<>0;
30+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,255,'/customised-training.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
31+
32+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=271 AND store_id<>0;
33+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,271,'/jobs.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
34+
35+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=277 AND store_id<>0;
36+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,277,'/refund-request.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
37+
38+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=428 AND store_id<>0;
39+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,428,'/how-to-register-wsq-course.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
40+
41+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=430 AND store_id<>0;
42+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,430,'/how-to-claim-skillsfuture-credit.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
43+
44+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_tg AND entity_id=437 AND store_id<>0;
45+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_tg,0,437,'/assessment-appeal-form.html') ON DUPLICATE KEY UPDATE value=VALUES(value);
46+
47+
-- relabel category 180 to 'Regional Franchisee'
48+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_nm AND entity_id=180 AND store_id<>0;
49+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_nm,0,180,'Regional Franchisee') ON DUPLICATE KEY UPDATE value=VALUES(value);
50+
DELETE FROM catalog_category_entity_varchar WHERE attribute_id=@a_lbl AND entity_id=180 AND store_id<>0;
51+
INSERT INTO catalog_category_entity_varchar (entity_type_id,attribute_id,store_id,entity_id,value) VALUES (3,@a_lbl,0,180,'Regional Franchisee') ON DUPLICATE KEY UPDATE value=VALUES(value);

0 commit comments

Comments
 (0)