I have 2 basic content types: "User" and "Server".

Each server page can be referenced by many users and in turn, create a corresponding relationship with the users from the server pages. What I'm trying to do is make the server pages display every user that is referencing the server. Problem is that I'm getting the following errors:

Reference overloading: would of had 2 references and only 1 reference is permitted. Before adding a reference, you would need to edit to remove an existing reference and resave this node to have make it correspond. Or you could allow this reference instance to have more references, go to the field settings for this instance.

1.) There's no indication about what specific field is causing the issue here. Don't get me wrong, I believe I already understand what it's implying but it would increase usability if the culprit field were also included in the error message.

2.) The field I'm suspecting it's referring to is already set to have multiple values, so this shouldn't be included in the error message as a means of fixing the error and in turn, this would create a more CONCISE error message.

3.) With the corresponding node reference, you could have multiple fields reference 1 node and that node show all of those which referenced it. Why can this not be the case with this module? I'm assuming it uses the equivalent functionality, yes?

Any insight into this is deeply appreciated.

Comments

wolf_22’s picture

Okay, I just found the field it was tripping over in my server content type, so everything appears to be working (I had to adjust the number to be unlimited, then do an update and it appears to have fixed the immediate issue).

However, points 1 and 2 still stand. The error(s) could be a bit more concise. (I know this sort of thing often takes the back-burner when you're in the middle of developing, so it's understandable that it's like this--not trying to step on your toes or whatever. :.) )

Keep up the great work. Your module is really fantastic.

phenaproxima’s picture

I was getting this error when CER tried to process an entity that referred to itself.

phenaproxima’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Assigned: Unassigned » phenaproxima
Category: support » task

Assigning to myself to fix in the 2.x branch. There is already protection against reference overloading, but I totally agree that the error message should be more informative.

Since the generic CerHandler class in 2.x throws an exception in the case of reference overloading, I will create a new exception type specifically for that which contains more info about the offending field.

phenaproxima’s picture

Assigned: phenaproxima » Unassigned
Status: Active » Needs review
StatusFileSize
new2.05 KB

Patch attached.

socialnicheguru’s picture

patch no longer applies

wolf_22’s picture

SocialNicheGuru: Please provide more information as to why the "patch no longer applies."

What version of Drupal are you using? What version of CER are you using? Why do you think the patch no longer applies and what exactly does that mean with your situation?

Please provide more information.

socialnicheguru’s picture

cer jan 2014 dev version on drupal 7.26

 git apply cer-1935326-overload-exception-4.patch
error: patch failed: handler.inc:32
error: handler.inc: patch does not apply

patch -p1 <  cer-1935326-overload-exception-4.patch
patching file handler.inc
Hunk #1 succeeded at 12 with fuzz 1 (offset -20 lines).
Hunk #2 FAILED at 353.
Hunk #3 FAILED at 378.
2 out of 3 hunks FAILED -- saving rejects to file handler.inc.rej
phenaproxima’s picture

Status: Needs review » Needs work

I think we (I or anyone who is interested) will need to re-roll that patch.

phenaproxima’s picture

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

Re-created the patch against the latest dev and renamed the exception to CerFieldOverloadException.