Error preparing data for the child element renderer.
The problem is that the child element does not come with an array a "null" and it assigns an array key with a value. For example: "$element[$key] ['#tree'] = $element ['#tree'];"

The child element is assigned "null" in the module: "uc_attribute", in the function: "_uc_attribute_alter_form()" and this "null" is rendered.

A simple option: instead of "null" pass an empty array, but the toga child element will be empty and it will be assigned to the blank parameters.

A more difficult option: to make checks for the emptiness of attributes, if not, then do not give an empty attribute parameter to the renderer.

Comments

yuraosn created an issue. See original summary.

yuraosn’s picture

Added patch
!!! The path of the patch from the root of the site, if someone else has a way to change the patch to apply.

yuraosn’s picture

Status: Active » Needs review

Status: Needs review » Needs work
yuraosn’s picture

yuraosn’s picture

Status: Needs work » Reviewed & tested by the community
tr’s picture

Priority: Major » Normal
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

When does this error occur? How can I reproduce this error?

There was a very similar issue fixed in #2750151: Return empty array instead of null for attributes form back in February - are you sure you're using the current -dev? _uc_attribute_alter_form() no longer returns NULL, it returns array().

(You can't mark your own issue as RTBC. See the Issue queue handbook)

yuraosn’s picture

Version: 7.x-3.x-dev » 7.x-3.10

That's right, the problem is not for the virgin version, but for "7.x-3.10".
In a similar problem was solved in a simple way, as written in my description.

A simple option: instead of "null" pass an empty array, but the toga child element will be empty and it will be assigned to the blank parameters.

With this method, the processing of child elements is wasted, although I do not see any reason why.

So I realized the second way, it is in the patch.

A more difficult option: to make checks for the emptiness of attributes, if not, then do not give an empty attribute parameter to the renderer.

yuraosn’s picture

Status: Postponed (maintainer needs more info) » Needs review
tr’s picture

Status: Needs review » Postponed (maintainer needs more info)

In Drupal, fixed-point releases like Ubercart 7.x-3.10 cannot be changed - if 7.x-3.10 has a bug, then it will always have that bug. Bugs get fixed in -dev, so bug fixes will become part of the next fixed-point release.

In this case, I believe the bug fixed and the fix is now part of Ubercart 7.x-3.11. If that's the case, then there is nothing to be done here.

yuraosn’s picture

Status: Postponed (maintainer needs more info) » Fixed
tr’s picture

Status: Fixed » Closed (duplicate)