Fatal error on Paint Layout Details screen after upgrade to 5.4.3.1


(Nic Hubbard) #1

Matrix Version: 5.4.3.1

We recently upgraded to Matrix 5.4.3.1 and everything went smoothly (much testing on a staging server). I just ran into the first issue.

When creating a new Paint Layout and going to the details screen I get the error:

Fatal error: Class 'Trigger_Condition_Edit_Fns' not found in /opt/matrix/packages/web_services/rest/triggers/trigger_condition_types/trigger_condition_rest_response/trigger_condition_rest_response_edit_fns.inc on line 28

Not sure why I would be getting this error on a paint layout. Editing a previously created Paint Layout’s details screen also gives this error.


(Nic Hubbard) #2

I added:

require_once SQ_CORE_PACKAGE_PATH.'/system/triggers/trigger_condition/trigger_condition_edit_fns.inc';

To trigger_condition_rest_response_edit_fns.inc and it fixed the issue.

Seems that source in git is missing that require_once line?


(David Schoen) #3

Hey Nic,

I’ve added a SquizMap to track this: https://squizmap.squiz.net/matrix/11616

I believe from looking at the code that it shows up when the row order in sq_ast_typ results in any trigger conditions being returned ahead of the parent “Trigger_Condition” type code.

E.g if I sort the list the details screen reliably works:

diff --git a/core/assets/paint_layout/paint_layout_page/paint_layout_page_edit_fns.inc b/core/assets/paint_layout/paint_layout_page/paint_layout_page_edit_fns.inc
index 150332254e..2dbcd4934b 100755
--- a/core/assets/paint_layout/paint_layout_page/paint_layout_page_edit_fns.inc
+++ b/core/assets/paint_layout/paint_layout_page/paint_layout_page_edit_fns.inc
@@ -62,6 +62,7 @@ class Paint_Layout_Page_Edit_Fns extends Page_Standard_Edit_Fns
                // Filter out irrelevant asset type codes
                $exlcude_types = Array();
                $types = array_keys($GLOBALS['SQ_SYSTEM']->am->getAssetTypes());
+               sort($types);
                foreach($types as $index => $type_code) {
                        $edit_fns = $GLOBALS['SQ_SYSTEM']->am->getEditFns(0, $type_code);
                        if (!isset($edit_fns->static_screens['layouts']) && !isset($edit_fns->static_screens['lookupValues'])) {

but if I reverse sort it, it reliably breaks (just replace sort(...) with rsort(...)).

Obviously this isn’t great.

Inserting the require you have done should be fine as a temporary solution.

Cheers,
Dave