Description
Short description of the issue
As non superuser, when editing a page having a Page Reference field (which has field-level access control), the rendering of the edit view fails, with :
Fatal Error: Uncaught TypeError: Illegal offset type in isset or empty in C:\xampp\data\www_smh\www\wire\core\Page.php:978 Stack trace: #0 C:\xampp\data\www_smh\www\site\assets\cache\FileCompiler\site\modules\AdminPageFieldEditLinks\AdminPageFieldEditLinks.module(155): Page->get(Object(PageField)) #1 C:\xampp\data\www_smh\www\wire\core\WireHooks.php(1050): AdminPageFieldEditLinks->{closure}(Object(HookEvent))
This is Page.php, line 978 :
if(isset(PageProperties::$basePropertiesAlternates[$key])) {
By catching the exception, it appears that $key is an object, of type ProcessWire\PageField,
actually it's a Page Reference field.
As a temporary measure, if I add the condition
&& !is_object($key)
then the rendering succeeds (but I have no idea of the implications, in terms of access control etc)
Note : Same pattern & issue on line 1397 :
if($value !== null && isset($this->wakeupNameQueue[$key])) {
Setup/Environment
- ProcessWire version: 3.0.203
- PHP version: 8.0.15