A PHP warning from the HivePress plug-in appears on each of the workflow edit pages of the Icegram Express plugin-in:
Warning: Attempt to read property "ID" on null in /home/httpd/vhosts/[domain.tld]/httpdocs/wp-content/plugins/hivepress/includes/components/class-admin.php on line 1138
Example page: https://[domain.tld]/wp-admin/admin.php?page=es_workflows&action=edit&id=6
The warning still appears after deactivating all third-party plugins and disabling custom snippets.
Edit any workflow and see the warning on top of the page
Actual result
PHP warning appears
Expected result
No PHP warning appears
Extra details
The Icegram support staff informed that it seems that the issue originates from the HivePress plugin and is not related to Icegram Express and recommended to reach out to HivePress.
Thanks for the detailed bug report. I inspected the code part where the error is triggered and this may be an Icegram Express issue, please try contacting their support again with these details:
The error occurs because the core WordPress filter hook add_meta_boxes stops passing the second parameter $post (or passes null) on Icegram Express pages for some reason add_meta_boxes – Hook | Developer.WordPress.org Please check if Icegram Express somehow uses/affects this filter hook, it should pass the post object as a second parameter as documented in WordPress, maybe one of the callback functions added to this hook affects this.
On our side, we’ll add another check if the post object is not null (in the next update), but it shouldn’t be null in any case as per the WordPress documentation.
Currently Express plugin need to trigger ‘add_meta_boxes’ action hook to render WordPress meta boxes on its workflow page.
Since workflow are stored in custom table and aren’t stored in the way other WordPress post or custom post types are stored, therefore loading workflow as a post won’t be possible currently.
Therefore before accessing post, if HivePress team can add checks for post is not null in their plugin that would be great.
No worries, we’ll change this in the next update, if it’s urgent please make the same change manually before the official release (e.g. via Plugins/Plugin Editor/HivePress):