Closed wsydney76 closed 5 months ago
Hi, thanks for getting in touch!
In v4
, you were defining your Element::EVENT_REGISTER_TABLE_ATTRIBUTES
and also had to define Element::EVENT_SET_TABLE_ATTRIBUTE_HTML
to specify what shows in the table column for the attribute.
In v5
you do the same with Element::EVENT_REGISTER_TABLE_ATTRIBUTES
and Element::EVENT_DEFINE_ATTRIBUTE_HTML
but you also need the Element::EVENT_DEFINE_INLINE_ATTRIBUTE_INPUT_HTML
to specify how the table column for the attribute behaves when using the inline editing mechanism.
You could, for example, pass the same HTML as used in EVENT_DEFINE_ATTRIBUTE_HTML
(e.g. via$event->html = $event->sender->getAttributeHtml($attribute);
) so that the image shows, but is not editable.
That being said, we’ll also discuss this internally.
@i-just Thanks, works perfectly.
For me it is fine, should just be mentioned in upgrading docs.
What happened?
Description
I have a custom column named 'bigImage' for the entries index that shows a bigger thumbnail:
It is registered analog to https://github.com/wsydney76/craft4-ddev-starter/blob/main/modules/base/BaseModule.php#L311
Works fine, however, when pressing the 'Edit' button, there is an ajax error:
Or maybe we have to opt out of editing in some way when registering the column?
Steps to reproduce
Expected behavior
No error, column is displayed as is.
Actual behavior
Error
EDIT:
Workaround for now:
Craft CMS version
5.0.0-beta.10
PHP version
8.2.13
Operating system and version
Linux 5.15.133.1-microsoft-standard-WSL2
Database type and version
MySQL 8.0.33
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
No response