Ajax Error in hook_ajax_render_alter

Created on 17 February 2023, over 1 year ago
Updated 2 May 2023, about 1 year ago

Problem/Motivation

Getting an ajax error that prevends ajax callbacks to be executed. The error occured on drupal commerce checkout - anonymous user - when shipping adresses are validated, but might happen in other circumstances as well.

Error: Call to a member function __toString() on string in frontend_editing_ajax_render_alter() (line 77) 

Proposed resolution

Don't use $command['data']->__toString() as $command['data'] might be not an object or null - cast instead (string) $command['data']

TBD

The render ajax hook should only be executed if user has permission "access frontend editing" and skipped otherwise.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany dreizwo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024