This is part bug report, part feature request.

Scald's sub module atom_reference moves the element to a key "sid" inside the returned array.
That means that there are no #entity_type, #field_name or #bundle keys on the element returned by atom_reference's widget form callback, resulting in some nasty notices (and MVW to not work).

The attached patch "fixes" this by introducing yet another special case (in addition to entity reference). Not a beauty, but it gets the job done.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ciss’s picture

Issue summary: View changes
Chi’s picture

Status: Needs review » Needs work

Can we find a way to support any contrib module? Do we have to hardcode support for each one?

ciss’s picture

I've already begun to heavily rewrite/restructure the module. One of the changes is that the theme registry no longer needs to be altered. hook_field_attach_form() is used instead to add the necessary information and overwrite the #theme key.

If you like you can add me as a maintainer with VCS access and I'll push a new feature branch as soon as I've found the time to clean up and comment the new code.

stefanos.petrakis@gmail.com’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Needs work » Needs review
FileSize
9.23 KB

It's been a while.

Here is an attempt at refactoring, in order to make it more generic. And more slender.
I mean to add some tests for this, in the meantime, if you could have a look and see if it solves the scald issue,
I checked and both node and entity reference work correctly.