Hi there,
I added an “Insert Image” button to the textarea button panel to ease inserting images with the (image: filename) syntax. It works like a charme if you define a select field for the image and populate the options with the query method. It does not work, however, if you use the Kirby core image field with thumbnail preview.
The error message is the following:
Fatal error: Method ImageField::__toString() must not throw an exception, caught Error: Call to a member function image() on null in [...]\kirby\toolkit\lib\brick.php on line 0
The actual call to the member function happens at \panel\app\fields\image\image.php::20.
As far as I tracked it down, $this->page is not set, but I cannot figure out, where it is set for image fields in the edit page view.
Does anyone know another way to use image fields in modals, when calling them from a textarea button?
Cheers