Download & Extend

Pass the Ajax callback for field with Node Reference URL Widget down to child NID element

Project:Node Reference URL Widget
Version:7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:postponed

Issue Summary

If I add #ajax behavior for element which uses Node Reference URL Widget it won't be processed correctly because real element with #ajax will be replaced by hidden Node Reference URL element. It can be solved by #after_build callback but it's inconvenient.
So I suggest to copy #ajax property in module.

AttachmentSize
ajax_fix.patch500 bytes

Comments

#1

Status:needs review» needs work

Hm, I was about to commit this patch when I realized this will needlessly add JS settings to the page for both the parent element and the child element. So I thought, "well, we'll just unset() the #ajax property after we've transferred it". Then I thought again... "but what if some other element is assuming the #ajax property hasn't been moved".

Then ultimately I figured that this approach in itself just isn't right. Other Field elements (like the file upload widget) include #ajax properties on the sub-elements that don't inherit from the parent property and you have to use #process to further modify the element in that situation also. So ultimately I don't think the approach is right here and I don't think we should include it in the project.

#2

Title:Ajax callback for field with Node Reference URL Widget doesn't work» Pass the Ajax callback for field with Node Reference URL Widget down to child NID element
Status:needs work» postponed
nobody click here