A PHP notice is triggered while trying to generate the [eventinstance:description] token.

Notice: Trying to get property 'value' of non-object in recurring_events_tokens() (line 100 of modules/contrib/recurring_events/recurring_events.tokens.inc

Apparently the description field is not declared in the EventInstance entity type, and I think it should point to the body field, that has not a specific token.

Thank you

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

plopesc created an issue. See original summary.

plopesc’s picture

Status: Active » Needs review

Update status.

owenbush’s picture

Thanks for the issue. Unfortunately, I do not think the patch makes sense and the reason for that is due to field_inheritance.

There is a body field on event instances, but by default it actually appends to the end of the body field from the event series. To do this, it uses the field_inheritance module to pull the data down from the series body field into a computed "description" field on the event instance. Then the event instance body field is appended to the end of that computed field.

Your set up may have moved away from doing this, and may not even use the description base field any more. But there is a description field, it is just a computed field.

What you may need to do is apply a patch to core from this issue: https://www.drupal.org/project/token/issues/3047568 which adds token support for all entity fields.

If that doesn't work then I may need to look into writing some custom code to support the description field.

plopesc’s picture

Status: Needs review » Active

Thank you for your input!

Big issue is that the field inheritance rule provided by the module was removed by accident.

This patch does not makes much sense, but would be great to find a solution that checks whether the fields are available or not.

Thank you!

plopesc’s picture

Status: Active » Needs review

Hi @owebush

Merge request updated just to avoid the PHP notices when the computed fields are not available in case of the default Field Inheritance rules are removed for any reason.

Thank you!

  • owenbush committed 5fc0609 on 2.0.x authored by plopesc
    Issue #3282502 by plopesc: Notice: Trying to get property 'value' of non...

  • owenbush committed 246d891 on 8.x-1.x authored by plopesc
    Issue #3282502 by plopesc: Notice: Trying to get property 'value' of non...
owenbush’s picture

Status: Needs review » Fixed

Thank you for the MR, it looked good so I went ahead and merged it into the two dev branches.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.