cancel
Showing results for 
Search instead for 
Did you mean: 

Category not editable, adapt Solution for V2.3.6 to V2.4.6

Category not editable, adapt Solution for V2.3.6 to V2.4.6

I can't edit existing products categories. As soon as I hit the save button, a error message appears.

This is the error message in the log file:

 

{"exception":"[object] (Error(code: 0): Call to a member function getAttributeCode() on bool at /var/www/magento/vendor/magento/module-catalog/Observer/InvalidateCacheOnCategoryDesignChange.php:67)"} []

 

I found a solution which allows me to save the categories again, but it is for V2.3.6 and throws out a new error in my V2.4.6.

 

This is the SQL:

 

attribute_id entity_type_id attribute_code


INSERT INTO `eav_attribute` (`entity_type_id`, `attribute_code`, `attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, `frontend_input`, `frontend_label`, `frontend_class`, `source_model`, `is_required`, `is_user_defined`, `default_value`, `is_unique`, `note`) VALUES

(4, 'custom_layout_update_file', NULL, 'Magento\\Catalog\\Model\\Product\\Attribute\\Backend\\LayoutUpdate', 'varchar', NULL, NULL, 'select', 'Custom Layout Update', NULL, 'Magento\\Catalog\\Model\\Product\\Attribute\\Source\\LayoutUpdate', 0, 0, NULL, 0, NULL),
(3, 'custom_layout_update_file', NULL, 'Magento\\Catalog\\Model\\Category\\Attribute\\Backend\\LayoutUpdate', 'varchar', NULL, NULL, 'select', 'Custom Layout Update', NULL, 'Magento\\Catalog\\Model\\Category\\Attribute\\Source\\LayoutUpdate', 0, 0, NULL, 0, NULL);

... and the "new" error message:

Column not found: 1054 Unknown column 'custom_layout_update_file' in 'field list', query was: INSERT INTO `catalog_category_flat_store_2` (`entity_id`,`parent_id`,`created_at`,`updated_at`,`path`,`position`,`level`,`children_count`,`store_id`,`all_children`,`available_sort_by`,`children`,`custom_apply_to_products`,`custom_design`,`custom_design_from`,`custom_design_to`,`custom_layout_update`,`custom_layout_update_file

 

 

Can someone help me to adapt the SQL code to V2.4.6.