I've searched through the issues and found some related to the "Add another item" button but none seemed to just outright say that it doesn't work. Doesn't work for me. Using garland theme and tried with various different types of cck fields. Pressing it does nothing.

CommentFileSizeAuthor
#19 Schermata-1.png78.78 KBmgorla
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mstef’s picture

[Correction] Seems to work with textfields. Not node or user reference, not file.

doublejosh’s picture

Also broken for me. I get the spinner with field added.
This is in Firefox and Safari.

My assumption is that it is conflicting with another AJAX element on the node edit page from another module.

markus_petrux’s picture

I also believe there's a conflict with another component on the page, maybe provided by another module.

There should be a method to reproduce the problem, otherwise it's pretty hard to understand what happens. Of course, assuming it works for a lot of other sites out there. The "Add another item" button should work out of the box with any kind of widget (text, noderef, etc.).

So, please see if there's any javascript error reported on the page, or try disabling other modules until the culprit shines.

eamonng’s picture

Broken for me too, trying to add new file uploads on Firefox 3.0.1 for Mac. Javascript error console is showing no error.

markus_petrux’s picture

Status: Active » Postponed (maintainer needs more info)

We need more information on how to reproduce this issue, otherwise it is quite impossible to guess what's going on.

viralbluesadmin’s picture

I see this issue every time I try to create a poll on 6.13. I have tried with both firefox and IE with no luck. I am getting no displaied errors or loggs about the issue. It just apears to do nothing.

csc4’s picture

Not sure if it helps but we're seeing it on all IE8 installations, not on IE6, Firefox or Opera.

Is there any connection with the array_merge_recursive problem reported at http://drupal.org/node/300084#comment-2036196?

markus_petrux’s picture

I haven't had the oportunity to test in IE8 yet. Do you get any javascript error? If not, then it could be quite difficult to guess what's going on. It could be related to jQuery version, other modules installed.

Re: "Is there any connection with the array_merge_recursive problem..."

I don't think so. If it was, that PHP warning would be failing for all browsers. That issue is probably just related to the nested fieldgroups patch.

Re: "I see this issue every time I try to create a poll on 6.13"

What do you exactly mean by "It just apears to do nothing."? Do the button submits but returns the form as it was? It does not even submit? Works with javascript disabled? Could you please confirm it works for you on any other content type but polls? Anyone else seen this issue related to core polls?

Obviously, the "Add more items" button works for almost everyone else, so it's hard to guess... we need to know how to reproduce this issue, otherwise this is dead.

markus_petrux’s picture

Ok, I have tested with IE8, and it worked here. It works the "Add more items" button for multiple value fields as well as multigroups.

I should say I have tested with jQuery 1.3.2 installed via jquery_update module. Maybe that makes a difference.

Otherwise, there should be something else that's breaking this feature. Maybe caused by some other module, maybe caused by something in the theme.

csc4’s picture

Thanks for trying - I'm trying to get my client to let you in so you can see it in action and also trying to persuade it to produce an error, but it just seems to loop.

markus_petrux’s picture

I'm afraid you'll have to debug this on your side. Try with other themes, try on a separate installation with just CCK and a multiple value field to see if the "Add more items" button works, then try with a multigroup. If it does not work, install jquery_update module, the version that upgrades Drupal to jQuery 1.3.2, because this could make the difference. If it works, then try installing modules one by one until the feature is broken and that will give you an idea.

Another method is debugging the code client and server side following what happens when the "Add more items" buttons is clicked.

himerus’s picture

I'm running across the same thing currently in a new installation of acquia drupal.

I've used CCK node reference, corresponding node reference, and popup add and reference on several sites now for an easy interface for creating complex relationships...

There are no javascript errors generated, the POST data is sent, and it's just not appending the data (extra field) to the end of the current set of fields.
I've never had to use jQuery udpate for this purpose, and have all the modules currently turned off that provide any manipulation of the node/node edit pages.

Can anyone else confirm if this problem is present in a default drupal install, or if anyone else is experiencing it in Acquia drupal?

markus_petrux’s picture

Well, the "Add more items" button is working for a lot of sites, otherwise we would had here a lot of reports. So, there should be something particular that breaks this feature. Hard to guess without a method to reproduce the issue, the tools to debug, and time to do it.

Just guessing... could this be related to caching issues? (node edit forms need to be properly cached).

himerus’s picture

believe me, I do understand, I use it on a TON of sites myself... I'm attempting to do my best to debug what can be causing it now on this new site... running comparison on modules, versions, etc on another current site in development that IS working just fine, and attempting to locate the culprit.

If I can find anything concrete once I can get it working, I'll post more info

himerus’s picture

Okay, I've located MY particular issue, although it boggles my mind, as I'm using the same setup on several sites.

When popups_reference is on, and on the content field settings, the "Show the "Add New: Node Type" Popup links" is turned on for the field, it is broken... when unchecking that box, I obviously remove the nice interface for adding a new node "on the fly", but the "Add another item" button is now working again as expected.

Oddest thing of all, is I have the same version of CCK, CNR, and popups_reference that I have on a site where it is working. no jquery update on either site. Only major difference is standard drupal vs. acquia drupal.

tttt’s picture

I have the exact same problem. Have you found a solution to this yet?

DavideOrazio’s picture

Same thing. I trie to install Jquery update, and tried to install popups api dev version.. doesn't work.

bob_hirnlego’s picture

I'm reporting this as well. Upgrading to jQuery 1.4 broke the feature.
Using CCK 6.x-2.x-dev.

mgorla’s picture

FileSize
78.78 KB

Ok, it's broken for me too..
Drupal Installation:
- Drupal 6.16
- CCK 6-2.6
- CCK 6-Link 2.8
- Popups Api 6-1.3

Using Garland Theme
Added this in page.tpl.php
<a href="node/add/page" class="popups">Add node</a>

Added additional link field to standard Page content type

The result is attached :)

Can anyone replicate this?

petermilad’s picture

It's the popup add and reference module.
I have the same issue. enabling this check box in content type edit page will cause the problem and disabling it the problem will go away. I'm now in two options, enabling the node addition creation on the fly against the multivalued node reference field!
A fast help is much appreciated.

petermilad’s picture

Status: Postponed (maintainer needs more info) » Active

Hello Markus,

I can give you all the info you need.

Regards,
Peter

Sivaji_Ganesh_Jojodae’s picture

KarenS’s picture

Title: "Add Another Item" Does Not Work » "Add Another Item" Does Not Work When using Popups API
Status: Active » Postponed (maintainer needs more info)

Is this only broken when using Popups API then? That's the way it sounds.

chrisfromredfin’s picture

I don't want to prematurely change the project on this issue, but this is pretty clearly related to popups api or popups_reference for me. Everything worked fine, then I installed those modules, then it stopped working. Disabled the "use popups reference" checkbox on my CCK field, worked fine again for me.

chrisfromredfin’s picture

Project: Content Construction Kit (CCK) » Popups: Add and Reference
Version: 6.x-2.2 » 6.x-2.0-alpha1
Component: Usability » Code
Assigned: Unassigned » chrisfromredfin
Status: Postponed (maintainer needs more info) » Active

Yes, the Popups Add and Reference near line 95 (popups_reference_alter_item) is hook_form_altering the CCK widget form to add a prefix and suffix.

The problem is that it doesn't account for an existing prefix and suffix, therefore blowing away the prefix and suffix that are put there to wrap it for #ahah['wrapper']. There's no JS error because there isn't really a JS error - AHAH was returning and everything was fine... it just couldn't find the wrapper it was supposed to insert into, so it simply did nothing and was silent about it.

Changing this issue to Popups: Add and Reference, since it should more robustly handle prefix/suffix and a complete change of the widget form using #ahah and 'add another item.'

I'm working on a patch.

lastent’s picture

I have checked the code and I think that what is happening is:

First: the button "Add new item" is not working propertly because it is looking for a id like "field-mytype-ref-items" but instead it gets one like thins "popups-reference-0", that I suppouse is necesary for "popups: add reference" to work, this id change in the alter form in popups_reference.module.

If you use firebug or something like that, you can try changing back the id to "field-fase-ref-items" and you'll see that it will work, it will add another item. Back the problem is that when a new item is added all that part of the fomr is updated, and when it tries to proces the alter_form from popups_reference.module, some conditions are not valid, so the "Add new: add mytype" doesn't appear.

I think I could fix this but I need some tuthoring as I am new in drupal.

Maedi’s picture

subscribe

ikeigenwijs’s picture

subscribe
I also ran into this problem.

sir.eduha’s picture

I solved this problem by modifying popups_reference.module (lines 95-96)

before:

$form[$key]['#prefix'] = '<div class="'. $wrapper_id .'">';
$form[$key]['#suffix'] = '<div>Add New: ' . implode(', ', $links) .'</div></div>';

after:

$form[$key]['#prefix'] = '<div class="'. $wrapper_id .'">'. $form[$key]['#prefix'];
$form[$key]['#suffix'] .= '<div>'. t('Add New') .': ' . implode(', ', $links) .'</div></div>';

it seems that $form[$key]['#prefix'] and $form[$key]['#suffix'] already have values ang we just keep it

mngates’s picture

sir.eduha -

Thanks for the code, I was really excited to try it. Unfortunately, it did not work for me, but maybe I just need a tweak for my site/theme. ? I'm using a Zen subtheme.

Did anyone else have luck with this? It would be great to be able to use. Any ideas are appreciated!

MantasK’s picture

ducdebreme’s picture

NOTE there is also a patch for Version 6.x-1.0

ikeigenwijs’s picture

Solved my problem, popup is not maintained and patch is till not committed.

LTech’s picture

I don't have the popup module installed but if I set a field 'unlimited' for one of my content types no 'add another' button shows up on the add node form. It is very strange because it works okay for the other content types.
How do I debug it to find out why it isn't showing? (I'm using drupal 7)

LTech’s picture

I worked out the conflict was with the get locations module. I've moved my issue to there http://drupal.org/node/1661848