Problem/Motivation

After installing version 2.3 of the module, I notice that the number of nodes that can be referenced in a Select List (or Radio Box for that matter), suddenly is limited to the first 25.
Wasn't able fo find a way to change this behaviour; cron did not help nor did clearing caches

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

varkenshand created an issue. See original summary.

Geater’s picture

This arbitrary 25 limit is hard-coded and was imposed as a "fix" for this issue:

https://www.drupal.org/project/references/issues/1345920

It caused chaos for one of our websites until we identified the issue and amended the module code, hoping the change is reversed (or fixed properly) in the next release.

Jelle_S’s picture

This patch removes the default limit

steinmb’s picture

Version: 7.x-2.3 » 7.x-2.x-dev
Related issues: +#1700112: Entity reference list View Pager: Items to display is broken

Entityreference also have a limit (in autocomplete), and I personally think there has to be limit to the result returned here, though there should be a way to alter this default limit some how.

steinmb’s picture

Title: Number of referenced nodes suddenly limited » Number of referenced nodes limit introduced in 7.x-2.3 cause chaos
Priority: Normal » Major

I would also say it it major.

kanagala.kalyani’s picture

Tried this patch and it is working for me. Thank you.

mike@nextstepdigital.com’s picture

This needs to be rolled into a fix ASAP.

steinmb’s picture

Tip: People still on node/user_ref. can try out https://www.drupal.org/project/entityreference_migration. Migrates your field, data, widget settings and views for you.

turtletrail’s picture

this caused a lot of problems on our websites well. And i agree it is a major issue.

The main problem is not that it's only loading the first 25, but that the actual referenced entity might not be within these 25 items that were loaded. That means when the form is submitted the reference field is updated to wrong value.

All in all the resaving of the form is no longer idempotent, as it should be.

LeDucDuBleuet’s picture

Priority: Major » Critical
Status: Active » Reviewed & tested by the community

I would say this is critical as well since the new version 2.3 with the forced limit at 25 will edit by itself untouched existing field values when editing an existing node.

I understand the idea behind imposing a limit there, it simply needs to be implemented differently in order not to modify existing field values with wrong data when editing an existing node.

I can confirm the patch in #3 fixes the problem for now with version 2.3.

Thank you for a great and useful module!

varkenshand’s picture

2.4 release goes without any clarification but the 25 hard coded limit is still present

tj2653’s picture

Well this was a pretty infuriating waste of 5 hours. I've had content with over 100 references, and it's been working flawlessly for years. Yesterday, I tried to add a reference and I received a slew of "this post can't be referenced" errors, and the nodes highlighted were scattered about (one reference error, 2 good references, 2 reference errors, 1 good reference, etc. -- then a bunch of errors in a row). I had updated the view associated with the references earlier in the week, so I thought maybe I had done something wrong there, so I checked all my filters, fields, relationships and other criteria in the view. Nothing solved the errors. After Googling, it seemed like it might have to do with caching, so I attempted that in various ways. Then I tried recreating the node and manually entering the errored references and it seemed to be working (nodes that were causing errors were saving), until I got about 25 nodes in, and it gave me one errored node. That made me think the errors were the result of some sort of limit, but I already had over 100 referenced nodes in there, so that didn't make any sense. Finally remembered I had updated some modules recently, saw the References module was a very new update, came here and saw this post. Thanks for the patch Jelle_S, and the other commentary, everyone.

wipeout_dude’s picture

Thanks for finding this.. The 25 limit was screwing us up as well.. We have hundreds if not thousands is referenceable nodes so a limit of 25 is crazy..

I am on 2.4 and we are having some other weird things.. When a view uses a node reference field as a filter, that is populated with some search criteria, and a node with an edit link is edited the node does not save.. If the filter is left blank the node will save.. Suggesting that the destination url containing the search criteria for the node reference field is causing an issue..

I am a little concerned that it may also save incorrect data.. We have nearly 220k nodes and if the references all get scrambled we are in big trouble.. I am rolling back to 2.2 in our production system which has worked perfectly for a long time..

srsoftware’s picture

I can confirm #9 in my setup. Patch 3 does the trick. Should be incorperated into new version!

pikadroo’s picture

I am absolutely furious about this. How dare Drupal allow this to happen. How dare you let a hack like this go out. Sites depend on fundamental systems like this to work and not be tinkered with. It doesn't even really matter to me what the original problem was, I am not even going to read it. Because whatever the problem was, BREAKING THIS FUNCTIONALITY WAS NOT THE CORRECT SOLUTION!

I can confirm the patch seems to work. Thanks to everyone here for the input.

Drew

LeDucDuBleuet’s picture

Would it be possible to have a new release 2.5 including the patch in comment #3 please?

steinmb’s picture

I will also remind people in here about #8 - Moving away from this module is not very difficult with no data loss. I have done this on multiple D7 sites without a lot of struggle but as usual. I it all depends.

pikadroo’s picture

steinmb: I will also remind people in here about #8 - Moving away from this module is not very difficult with no data loss. I have done this on multiple D7 sites without a lot of struggle but as usual. I it all depends.

Can you go into more detail on this point?

1. What does it mean by migrate.
2. Does it replace this garbage reference module, that was BTW approved by drupal.
3. Rather than me or others spending time trying to figure out the process, what is the process.

Drew

steinmb’s picture

@pikadroo Following up on my comment in #8. This is the generic steps:

* Install entityreference and entityreference_migration modules
* Migrate/convert your content types. Use drush to do this.
* Disable node/user references module and never ever use it again.

It will change all your existing node/user references to standard entity references. It will try to keep your node form widget settings, update your views to match the new reference methods. As this changes your data structure please do not run it directly on a live site but do it in a development sandbox. You do not have a local development env, at least make sure you have a fresh db. backup. I have not had any data losses with this module though.

https://www.drupal.org/project/entityreference_migration have nothing to do with the migrate module only shares the namespace.

rod-on’s picture

When upgrading from 7.x-2.2 to 7.x-2.3 I also get this error. Rolled back to 7.x-2.2

varkenshand’s picture

Why is it so difficult to release a working version of this module? Especially because the patch is already available?
I had a look at the module from #8, https://www.drupal.org/project/entityreference_migration but no thank you. A module that has not been touched for five years, unmaintained, with only 400 downloads, is not an option for my site with 1900 nodes

steinmb’s picture

@varkenshand the module is a utility module. Sites turn it on, migrate and uninstall it. Those 400 must have forgot to uninstall it after use :)

joshuautley’s picture

#3 Patch worked for us. Quite the bummer that we have to go back and check the boxes to re-create all these relationships (e-Commerce store).

I agree that this could have been handled better. Moving forward the option to set the limit using an interface would be a nice feature add.

If the patch is not included in the next release I hope I remember to patch it again so I don't have to re-create all those relationships again.

jaspm2004’s picture

i had this problem too after updating to 7.x-2.4

#3 worked like a charm, thanks!

LeDucDuBleuet’s picture

This makes no sense imposing that limit when it breaks existing sites!

Would it be possible to have a new release 2.5 including the patch in comment #3 please?

introfini’s picture

Same here. I wasted an entire day before discovering this.

tawellman’s picture

Why! Why would you impose a limit? ... and why 25? hell, why not 22 or even better lets go for 21!

What a mess it has created for us. NO sense in going into detail how completely frustrated I am right now.

Please Fix it! Because of our site is built with a high reliance on Node Reference URL Widget, we do NOT have an option to migrate to Entity References.

Update: Patches didn't work for me. I ended up having to roll things back to references-7.x-2.2 to get it to work. Now dealing with nodes not saving correctly. Pops up missing everything. Even when I go to edit it, everything is not there. On a new node, if I clear cache right after saving it, the node appears perfectly. Can even edit it with all the original data as it was supposed to be.

I hope it isn't because I had to roll back to references-7.x-2.2. What a pain in the ...!

steinmb’s picture

@tawellman - If you migrate to Entity References. try https://www.drupal.org/project/entityreference_prepopulate - Back in my Drupal 7 days we used on several large sites and it always did it's thing.

LeDucDuBleuet’s picture

@steinmb Good for you your Drupal 7 days are behind! We are not all in the same boat. You suggested the other module multiple times here, thank you very much. Just keep in mind that even though there is an available alternative, we are not always at liberty to take it for various reasons depending on the project. You made your point and now you can move on if you have nothing else to say...

@maintainers Could you kindly publish a new release 2.5 including the patch in comment #3 please?