Closed (fixed)
Project:
Relation
Version:
7.x-1.x-dev
Component:
Entity collector
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 May 2012 at 17:07 UTC
Updated:
7 Mar 2014 at 16:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
chx commentedComment #2
joachim commentedI wasn't sure whether to call this a bug or a feature request, but I presume it can lead the user to try to add things that just produce an error -- hence a bit of a UI bug.
Comment #3
joachim commentedTrying to add an entity that won't fit into the selected relation produces an AJAX error:
Can we call this a bug now?
Comment #4
chx commentedYes :)
Comment #5
pyxio commentedGreetings,
I get the same error. Just letting you know. Cheers, Kevin
Comment #6
Uncle_Code_Monkey commentedI ran into this issue myself and created a patch for it. First time submitting a patch, so I hope it works.
I basically copy the previous IF section that filters endpoints based on defined source/targets and instead just run the same thing only on the defined sources (since there won't be any targets).
Comment #7
Uncle_Code_Monkey commentedResubmitting patch because I needed to change the issue status to "needs review".
Comment #9
Uncle_Code_Monkey commentedAfter going back to the drawing board and spending quite a bit more time on solving the filtering issue with AJAX, I've got another patch ready.
Patch highlights:
Comment #11
Uncle_Code_Monkey commentedBased on the testbot feedback, I believe I have fixed the warnings as well as modified the test to account for the ajax work disabling the relation type select field.
Comment #12
steveoliver commentedUncle Code Monkey++
Passing tests looks good. If everything else looks good, a few Drupal coding standards nitpicks:
You can use the Coder Review module to help spot them.
Spaces:
')<1)' should be ') < 1)'
Space between // and User (capitalize User)
Along with space, maybe rewrite to fit in 80 char.
Maybe something like
// Auto-pick option if it is the only option.I'd do:
Just my preference, I guess, but I'd remove the wrapping parens from isset() check.
Spacing, capitalization, and punctuation.
...etc.
Comment #13
Uncle_Code_Monkey commentedThanks for the coding standards tips and especially the module to help spot check. I'll admit that I have not read all of the documentation regarding coding standards and basically tried to follow the code as I read it. I prefer to encase all my boolean evaluations in a set of (), especially if it's in the form () ? :. But that is a personal preference, but I'd rather use the standard for patches. I'll modify the patch so it fits and resubmit later.
Comment #14
Uncle_Code_Monkey commentedSame patch as in #11, but this time with changes to better match the coding standards.
Comment #15
mikran commentedI was about to commit this but final testing gave me a fatal error. This happened when I tried to select 3rd node for my arity 2 relation.
Fatal error:
Recoverable fatal error: Argument 2 passed to drupal_array_get_nested_value() must be of the type array, null given, called in /var/www/d7/modules/field/field.form.inc on line 394 and defined in drupal_array_get_nested_value() (line 6578 of /var/www/d7/includes/common.inc).Error message that got displayed afterwards
Relation has too many end points (is_subnode_of max arity 2)I didn't reroll the patch yet, this error occured with the version at is was when the last patch was posted.
EDIT: If you don't select entity but submit the form without the error message does not get displayed to user (until next page load).
Comment #16
Uncle_Code_Monkey commented@mikran What you described in comment #15 has been the case for a while now and this patch does not even try to address such an issue (it only handles filtering the possible selections, not modifying the behavior of trying to choose more than what your relation defines). If you want this issue also addressed and fixed, I highly recommend it be a separate issue and not hold up this particular one.
Comment #17
darrellduane commentedI attempted to apply the patch in #14 but it wouldn't apply to the dev version released on February 7th. I have manually applied it and will post a patch shortly.
Comment #18
mikran commentedFair enough but, by the original bug report it's in scope to also limit by the amount of endpoints in addition to their type. Also tests are something that we need to go with this
Comment #19
darrellduane commentedHere is the patch described in #17
Comment #20
mikran commentedAnother reroll
Comment #21
clemens.tolboomI get the error mentioned in #3 and again in #15 too.
Doing some debugging it appear when defining selecting an endpoint of a directed relation.
Could it have someting to do with the logic of
I had the same entity twice in my session.
Refreshing the page give a lot of validation hints on the wrong start-point / end-point for by directional relation.
Choosing the correct start-point then end-point makes it work. So patch solves what it advertises. The error has some other cause.
Should that be another issue? Yes please. RTBC to me.
Comment #22
mikran commentedComment #23
mikran commentedThis patch fixes multiple AJAX related issues with entity collector. Now when endpoint is picked all of the entity collector form elements are updated to ensure that any changes to them are actually updated to form. Also any validation errors are now properly displayed inside the block.
Comment #24
mikran commentedfixed
Comment #25
mikran commented