Append to #prefix and #suffix instead of overwrite
cYu - March 10, 2009 - 19:03
| Project: | Popups: Add and Reference |
| Version: | 6.x-2.0-alpha1 |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | starbow |
| Status: | needs review |
Description
In case other modules are altering the #prefix and #suffix of an element, this patch will concatenate the needed divs.
| Attachment | Size |
|---|---|
| prefix_suffix.patch | 1.09 KB |

#1
Seems like a good idea.
#2
I think this might correct http://drupal.org/node/388458
#3
Drat, I should have rolled this into 1.0. I will aim to get it into 1.1
#4
This is rolled into a different patch #388406: multiple values nodereference field
#5
Un-duping with hopes that this simple patch can get in without the other code involved with the issue this was originally considered a dupe of. See http://drupal.org/node/388406#comment-1418308
#6
Marking as a bug since 2 different issues report that this may fix existing problems.
#7
Just tried the patch posted here:
http://drupal.org/node/388406#comment-1603308
Didn't work. =(
The "Add another item" button worked, but the "Add New: Content Type" link vanished. Doh!
#8
Correction, that patch *did* work. =)
It's practically identical to the one in this issue as well. Someone might want to review both before deciding which "style" to include. But anyway, works.
My problem was a different bug. If you use a view to populate your CCK node reference field instead of the default mechanism then the "add content type" link won't appear - I had this issue and it threw me off.
So for now, reviewed and tested by at least one person! Is this already in the dev snapshot because of another patch? Is someone somewhere else killing kittens?? =P
#9
Patch no longer applied to 6.x-2.0 release. Here it is re-rolled.
#10
The re-rolled patch is missing the concat for #prefix.
#11
Here is a re-rolled patch for the 2 branch.
#12
@cYu: thanks for the patch
I am going though my patch list and putting the patches to review in an external todo list, so hopefully I will be keepting track of things better (fingers crossed :)
#13
The current patch appends to prefix and suffix instead of overwriting, but the "Add New..." link disappears when clicking on the "Add another item" button for node reference fields.
I've attached a patch that fixes that by adding the popup wrapper before the prefix, and adding the "Add New..." link after the suffix. The will allow the node reference form to rebuild and not remove the "Add New..." link.
- Luis