- Issue created by @rymcveigh
- π¬π·Greece vensires
@rymcveigh, I have the same problem in a website we have built. I there use the comments as a property in a custom entity though and not using the field UI. In order to get more information, could you tell us if you are using the field UI in your entity with the comments or not?
- 71038010 committed on 2.x
Issue #3336542: Call to undefined method BaseFieldDefinition::...
- 71038010 committed on 2.x
- Status changed to Fixed
over 1 year ago 4:13pm 27 June 2023 - πΊπΈUnited States robphillips
Confirmed using a comment base field definition. 3.x depends on
third_party_settings
to allow distinct configurations per comment field instance. Base fields don't implement theThirdPartySettingsInterface
hence the error. However, base fields can define thethird_party_settings
key in the definition settings (see example below). The module code has been adjusted to support both configuration and custom base fields.$fields['comment_extra'] = BaseFieldDefinition::create('comment') ->setLabel(t('Custom Comment Field')) ->setSetting('comment_type', 'comment') ->setSetting('third_party_settings', [ 'comment_delete' => [ 'operation' => [ 'hard' => 'hard', 'hard_partial' => 'hard_partial', 'soft' => 'soft', ], 'visibility' => 'visible_multiple', ], ]) ->setDefaultValue([ 'status' => CommentItemInterface::OPEN, ]) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE);
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
9 months ago 5:01pm 15 February 2024 - πΊπΈUnited States rymcveigh
I ran into this same issue and had to dig for a while to find this solution. Could we update the documentation in either the readme or the module description so that folks have an easier time defining the third-party settings on custom baseFieldDefinitions?