Closed (fixed)
Project:
AJAX Views
Version:
5.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 May 2008 at 09:20 UTC
Updated:
21 May 2008 at 16:39 UTC
Great module, but I can't see why arguments are replaced with wildcards. Most of my views are pretty useless without their arguments. I had no problem changing _generate_ajax_url to suit but I'm curious as to why it's designed that way.
Comments
Comment #1
febbraro commentedI was having problems when not replacing with the wildcard that nothing was showing up. I was not really relying on arguments for the data, but I can absolutely see how the views would be useless without them. It was my next bridge to cross. Were you having problems when the wildcards were in inserted? Also how are you specufy arguments to the views in What changes did you make and do you think they are generally applicable? If so I would gladly accept a patch. Thanks for using, I hope it helps you.
Comment #2
chaps2 commentedMy quick fix was suited to the fact that I'm using views within panel panes so it's easy to specify the ajax argument explicitly. I just return the views->real_url from _generate_ajax_url.
Otherwise I suppose it would be quite easy to get the arguments using $views->args[$argument['position']] when generating the url and use wildcards for missing arguments only.
Andy
Comment #3
magoo commentedthis function:
removes all the arguments.
As far as I understand, it replaces the arguments by either "*" or $argument['wildcard'] (configured wildcard). Never does it test the existence of the argument.
I replaced it with the following:
in order to copy the argument in the ajax call url.
I have it working with one argument (in addition to the AJAX pagination argument).
Comment #4
febbraro commentedhanks for digging into that. Also, have you had a chance to try it with more than one argument?
I will find some time soon to work this into a new release.
Comment #5
magoo commentedHello,
I have tested it with the following arguments list (in that order)
and the block is called with this:
the resulting url is:
and it works.
From my point of view, this is enough. The only problem in collecting the arguments is that
if ($argument['type'] == 'ajax_response') { ...must be handled first and exclusively because we don't want the user to put a custom value in place of/ajax. This may change in the future, if the module adds more functionalities using the argument to differentiate calls.Sorry for not posting a patch but the windows workstation at work is not my friend.
Comment #6
febbraro commentedMagoo thanks for doing the leg work here. I have put your code in place and things look good from my perspective. I will commit this to CVS and create a new release.
Thanks again.
Comment #7
febbraro commented