Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When generating message for EntityMetadataWrapperException, both EntityMetadataWrapper::set() and EntityDrupalWrapper::set() call var_export($value) which sends the return value to output instead returning it which is the intended behavior.
This breaks e.g. JSON responses from e.g. system/ajax calls, if exception occures during processing of ajax request.
Proposed resolution
Replace var_export($value) with var_export($value, TRUE) to correctly return the exported value.
Comment | File | Size | Author |
---|---|---|---|
#2 | var_export_fix-2842371-2.patch | 1.35 KB | matrixlord |
|
Comments
Comment #2
matrixlord CreditAttribution: matrixlord commentedHello,
Uploaded fix for current 7 dev version.
Comment #3
richard.thomas CreditAttribution: richard.thomas commentedI've run into the same issue of this breaking JSON responses, the patch is very simple and fixes the issue, so I think we can mark this as RTBC.
Comment #4
IshaDakota CreditAttribution: IshaDakota commentedThis is committed in 7.x-1.9 - can be closed.
Comment #5
dasj19 CreditAttribution: dasj19 commented