This issue was discovered while using media browser in conjunction with radix as the front end theme. When changing an image via media browser and saving the node the above php fatal will occur. This was tested within an inline entity form and I have not tested independently of the inline entity form.

The problem appears to be with the way that radix includes files which creates the possibility of them being included on pages that use the administration theme. This means that radix_element_info_alter fires and attaches the process function but on submission of the form the files are not included (they shouldn't be) causing the fatal error.

Patch attached to load include files using the info file in the standard Drupal way.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xenza created an issue. See original summary.

JamesDevware’s picture

Issue summary: View changes
FileSize
1.08 KB

Sorry, removing diff file extension.

JamesDevware’s picture

JamesDevware’s picture

FileSize
1.08 KB
JamesDevware’s picture

Status: Active » Needs work
JamesDevware’s picture

JamesDevware’s picture

Ignore above patches, The issue was that media/ajax/* doesn't use the admin theme so when the form elements are loaded they have the radix process attached to them. On submission of the form the admin theme is used (rather than radix) so drupal doesn't load the include files that are required to run the process function resulting in the PHP fatal error.

I am not sure that using hook_element_info_alter and #process is necessarily the best way to go given that the theme is not always loaded. This does seem to be causing a few issues.

JamesDevware’s picture

Status: Needs work » Needs review
FileSize
1.34 KB

Switching from using #process to #pre_render appears to maintain the intended functionality of adding classes to the elements but without causing issues when mismatched themes are used when loading forms and submitting.

shadcn’s picture

Testing. Thanks.

adam-delaney’s picture

Status: Needs review » Reviewed & tested by the community

Tested and this patch resolves my issue.

adam-delaney’s picture

Updating this patch to work with the 7.x-3.x-dev branch

adam-delaney’s picture

This issue is causing major problems primary when ajax calls are being made in the administration theme. I would be great if we can get this reviewed and committed. Thanks.

shadcn’s picture

Status: Reviewed & tested by the community » Fixed

Thanks.

Status: Fixed » Closed (fixed)

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