Hi @jonom, in SS6.1.10 I get the following error when clicking on a file in file Admin:
ERROR [Emergency]: Uncaught Error: Call to a member function getX() on null
IN GET /admin/assets/schema/fileEditForm/3
Line 85 in /var/www/html/vendor/jonom/focuspoint/src/Forms/FocusPointField.php
Source
======
76: $w = intval($this->config()->get('max_width'));
77: $h = intval($this->config()->get('max_height'));
78: $previewImage = $this->image->FitMax($w * 2, $h * 2);
79:
80: if ($previewImage) {
81: $state['data'] += [
82: 'previewUrl' => $previewImage->getURL(),
83: 'previewWidth' => $previewImage->getWidth(),
84: 'previewHeight' => $previewImage->getHeight(),
* 85: 'X' => $this->image->getField($this->getName())->getX(),
86: 'Y' => $this->image->getField($this->getName())->getY()
87: ];
88: }
89: }
90:
91: return $state;
This is, cause the name of the field is not set properly. I debugged it and it gets lost in a parent class; Then getName() returns the title (wich is "Focus point") with stripped space; Then the image doesn't find the correct field...
A possible fix is to change the last two lines in FocusPointField::__construct()... first call parent::__construct(), then set the name again.
Hi @jonom, in SS6.1.10 I get the following error when clicking on a file in file Admin:
This is, cause the name of the field is not set properly. I debugged it and it gets lost in a parent class; Then
getName()returns the title (wich is "Focus point") with stripped space; Then the image doesn't find the correct field...A possible fix is to change the last two lines in
FocusPointField::__construct()... first callparent::__construct(), then set the name again.