Closed jeremyshearer closed 13 years ago
Hi, I've encounter the issue of pagination links redirect to our website main page instead of the search links. Was using 1.3, upgraded to 1.4.0 also same issue. Please help. Before upgrading to 1.3 when using 1.1.1, everything was fine.
If it helps, I'm using Modx Revo 2.1, with version 1.4 of SimpleSearch.
still trying to figure this out. I found this post (http://modxcms.com/forums/index.php?topic=63467.0) where makeUrl was returning an empty string because the anonymous user didn't have sufficient permissions in the context they were using. My example is also in a context other than web, however I tried adding the permissions and then flushing permissions and settings but I'm still not getting any output for the href attribute of the pagination link.
Looks like it's definitely a context issue for me. I added a simple search form to my main 'web' context and the pagination links were returned correctly. I check my secondary context's settings against the page here: http://rtfm.modx.com/display/revolution20/Creating+a+Subdomain+from+a+Folder+using+Virtual+Hosts and didn't see any issues. I've tried manually setting the context in my simplesearch snippet call, but to no effect.
i just change the [[_id]] to [[_alias]] and the pagination links are back to norm.
@seekdiver where did you make the chang efrom [[_id]] to [[_alias]]? are you using a custom template for the pagination links?
do you know the SearchFormTpl chunks? the form action="[[*id]]" , yes we are using custom template.
Here is my solution:
Our web is using multiple contexts. Pagination failed with using custom contexts.
API tells: http://api.modxcms.com/modx/modX.html#makeUrl string makeUrl (integer $id, [string $context = ''], [string $args = ''], [mixed $scheme = -1])
but there are swapped and shifted parameters at simplesearch.class.php at line 206:
$pageArray['link'] = $this->modx->makeUrl($id, $urlScheme, $parameters);
where $context missing. $urlScheme and $parameters are swifted. So $urlScheme belongs to $context, $parameters is at right position and the last parameter (urlScheme) is missing.
So corrected line is: $pageArray['link'] = $this->modx->makeUrl($id, $this->modx->context->get('key'), $parameters, $urlScheme);
Perfect! Big thanks to Pavuk for the solution, I made the change proposed and my pagination links are now being built correctly.
The href attribute on the anchor tag is blank. It's as if [[+link]] is returning nothing in the default template. sample output: 2 |