Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm having an issue with the search and reference functionality.
When I open a search and reference modal frame window I'm able to select a node to reference without problems. If I open the search and reference window and perform any paging or filtering I can no longer select any nodes to reference.
This happens with both the grid and table view.
Has anyone else had this issue?
Comments
Comment #1
MarcElbichon CreditAttribution: MarcElbichon commentedI have the same problem. I've corrected it by replacing line
by
in views\js\ajax_view.js
Comment #2
R.J. Steinert CreditAttribution: R.J. Steinert commentedI'm debugging this problem right now in 6.x-1.6-dev. @MarcElbichon I'm not sure we're experiencing the same bug.
After poking around for a bit I noticed that $('td.views-field-noderelationships-nid', table).each(... was coming up null after updating the view (with search, pager, etc.) and not iterating over the rows in the table. Looking at the markup, after updating the view (using pager, searching, etc.) I noticed that the classes on the tags of the tables have change. For example, when you first load the view in the modal each
So the question is, why does the markup for the view come out differently after being updated?
Comment #3
R.J. Steinert CreditAttribution: R.J. Steinert commentedSpelunking noderelationships.inc I don't see any difference in the resulting variables during run time when the view is loaded normally vs when the view is loaded with ajax. Perhaps the root of this problem is an assumption about Views output that is no longer true, but someone who is more familiar with this code could probably tell.
So, given that we can't assume that views will add the classes the rest the noderelationships javascript expects, here's a patch that adds those expected classes using javascript in case they don't exist so we get the desired behavior after an ajax load of the view.
Comment #4
MarcElbichon CreditAttribution: MarcElbichon commentedPatch has no effect for my problem.
My problem is following :
I've a view with exposed filter. When I open search popup, row selection works
When I change expose filter and clik on apply, row selection doesn't work.
With Firebug, i see context var contains another context var.
With hack #1, context var contains only document var
Rather than hacking views javascript, this code do the trick
Comment #5
R.J. Steinert CreditAttribution: R.J. Steinert commentedI'm seeing an undefined context variable is passed into Drupal.behaviors.nodeRelationshipsReferenceDialog after updating filters or the pager. So, setting context = context.context doesn't help because context.context is also undefined. It seems really strange that context would be undefined... Maybe Modal is screwing up Drupal.behaviors?
@MarcElbichon I'm using 6.x-1.x-dev. Which version are you using? Also, are you using jquery_update module? Views version and Modal version may be a factor as well..
Comment #6
MarcElbichon CreditAttribution: MarcElbichon commentedJquery-update 2.0 alpha1
Views 2.x-dev
Modal frame api 6.x-1.7
Node relationships 6.x-1.6
Comment #7
kongoji CreditAttribution: kongoji commentedI managed to make it work for me trimming the nid and title in
noderef_dialog.js
Comment #8
Zatox CreditAttribution: Zatox commentedI used patch #3 for a table style with the same issues. It did work but since I use "title" and "nid" views fields to build some other tds, the classes were added to those to: so I had my extra columns hidden. I modified the code added by the patch to this:
This way tds are not targeted by their class who are the same but by their position (first and second). I'm assuming the two columns always appear in first so this should work for any custom view. (it works on my custom view). Pretty much the same logic for the headers.
I have another issue but I'm posting it here because i think it is related, at least, to #5:
I'm using rjstatic's oa_noderelationships (1.1) module to solve theming problems. Paging and filtering cause the pager to, somehow, go through the template.php of my OA theme (wich is based on Gingko) and not Garland as it should. I guess it is related to the undefined context variable rjstatic was talking about in #5
So it seems the ajax goes through views normal ajax system without it being processed by noderelationships.
Comment #9
Zatox CreditAttribution: Zatox commentedPatch for what I explained in #8