Hello,

Thank you for the module and its functionality.

I have encountered a problem with all field types allowed to the module. In our case we use multiple entityreference field. The problem is that when we remove some value and then without saving the whole node we click "Add another Item" the last row value is added no matter which value we have removed. Is this a normal behaviour? We need when clicking on "Add another Item" to get empty field.

Any help is appreciated.
Thank you in advance!

Comments

martichka5 created an issue. See original summary.

alex.bukach’s picture

Category: Support request » Bug report
Status: Active » Needs review
StatusFileSize
new2.35 KB

I have faced the same issue, here's the patch.

The reason was that the values for field items (if not set in form state values) are taken from entity stored in $form_state, and therefore to have proper (empty) value of the newly added item, we should process the entity the same way we do for the form and form state.

Koen.Pasman’s picture

Thanks a bunch! I was using this module together with taxonomy_orderselect (patched) but it failed to work properly. However, with this patch applied it works when I'm removing existing references.

However, I still run into problems when adding new values. I select a value, click 'add a new item' and the previous value is pretty much discarded.
This was caused by me using the taxonomy_orderselect module instead of the multiple_select module. I recommend using multiple_select instead of taxonomy_orderselect!

lolandese’s picture

Status: Needs review » Reviewed & tested by the community

Tested with a multi-value text field I confirm the issue. Removing a field value makes that a newly added is pre-filled with the last removed value. It has to be noted that usually you get an empty field already available, so this applies in the situation you want to add more than one new value.

The patch applies cleanly and solves the issue.

lolandese’s picture

Version: 7.x-1.5 » 7.x-1.x-dev

Can this be merged in dev? Thanks.

mrpauldriver’s picture

Be good to see this committed to a 7.x-1.6 release

  • semjuel committed 85a9186 on 7.x-1.x authored by Alex Bukach
    Issue #2724681 by Alex Bukach: Does not work when trying to add new item...
semjuel’s picture

Status: Reviewed & tested by the community » Fixed
pifagor’s picture

Version: 7.x-1.x-dev » 7.x-1.5
Assigned: Unassigned » pifagor
Status: Fixed » Needs work
pifagor’s picture

Status: Needs work » Needs review
StatusFileSize
new1.29 KB

The previous patch does not work for version 1.5.
I added a new patch. It is not optimal, but it works.

  • pifagor authored dbadbfb on 7.x-1.x
    Issue #2724681 by pifagor: Does not work when trying to add new item...

  • be328ad committed on 7.x-1.x
    Issue #2724681: Improve logic
    
semjuel’s picture

Status: Needs review » Fixed

Please use version 7.x-1.6-alpha2

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.