Hello,

I have setup the following URL Alias in my Drupal 6.20 setup by using the following URL Aliases module:
search/apachesolr_search?filters=tid:249 pointing to /hotels

Unfortunately however if i go to
www.domain.com/hotels the result i expect are not loading.

If i do this:
www.domain.com/search/apachesolr_search?filters=tid:249 the results appear as expected.

In addition, if i go to Administration and try to add a Menu Item in my Primary Navigation links by setting the menu path to hotels I get the following error:

The path '/apachesolr_search' is either invalid or you do not have access to it.

Please advise what to do.

CommentFileSizeAuthor
#12 1112256-url-parse-12.patch983 bytespwolanin
#9 screen.png125.35 KBkrymp

Comments

arekanderu’s picture

It seems that the error i am getting is related with the ?filters=tid:249 I am trying to add in my url alias. If i make a search/apachesolr_search/hotels alias it works just fine but thats not the query i am trying to build.

pwolanin’s picture

I think the short answer is that won't work. I don't think you can include a query string in a path alias.

Instead, define new page callbacks via hook_menu.

e.g. see: http://sf2010.drupal.org/conference/sessions/apache-solr-search-mastery

pwolanin’s picture

Category: bug » support
Status: Active » Fixed
arekanderu’s picture

I don't understand why would they put such a limitation to the menu system.

Anyway, this is a problem [in combination with apache solr] which I think others probably have too, to define a search query and provide it as a menu link that is. If anyone has already solved this please share with us.

Thank you for your answer, I will have a look at the link.

pwolanin’s picture

The path aliases system is separate from the menu system.

You can define your saved search as a menu link, but it will be with the full query string exposed.

arekanderu’s picture

I removed the alias and i tried to add a menu item in primary navigation and i got the error mentioned on topic. More specifically i tried to add the following path:

search/apachesolr_search?filters=tid:249

Unless you meant something else...

arekanderu’s picture

Status: Fixed » Needs review

Would someone be kind enough to check post #6 since this wasn't actually fixed? Is this a problem of the drupal menu system or related with the apache solr module?

jpmckinney’s picture

Status: Needs review » Active
krymp’s picture

StatusFileSize
new125.35 KB

I am having the same issue too on drupal 7 when trying to create an alias here for:
amazon_store?SearchIndex=VideoGames&BrowseNode=14220161

I get this error message: The path 'amazon_store?SearchIndex=VideoGames&BrowseNode=14220161' is either invalid or you do not have access to it.

I am attaching a screenshot.

pwolanin’s picture

Project: Apache Solr Search » Drupal core
Version: 6.x-1.x-dev » 8.x-dev
Component: Miscellaneous » menu system
Category: support » bug

I've just confirmed this on 6 and 7 core. Looks like a core bug to me. Sure query string parsing should be supported from the link add form.

pwolanin’s picture

I enter "search/site/ex?fq[]=uid:9" the error message is: "The path '/site/ex' is either invalid or you do not have access to it."

chx suggests this is possibly a bug or quirk of parse_url() or an incorrect use of it in Drupal core and if we want to use it here, we might need to switch parsing methods, or possibly append a fake protocol/host in front to work around this problem.

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new983 bytes

ok, so this patch is from ChX. I can confirm it solves the main bug, which is that Drupal paths + a query string with a colon ":" are mis-parsed.

It needs code comments and a regression test, but setting CNR for initial testbot pass.

I also see that when I save a link like "search/site/ex?fq[]=uid:9", and go to edit it again, it's presented as urlencoded in the form like "search/site/ex?fq%5B%5D=uid%3A9". Then, if I save again parts of it are double-encoded.

pwolanin’s picture

Title: The path '/apachesolr_search' is either invalid or you do not have access to it. » Adding a menu link via the menu module UI with a query string exposes multiple bugs
kscheirer’s picture

Issue tags: -url_aliases menu

#12: 1112256-url-parse-12.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1112256-url-parse-12.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Version: 8.9.x-dev » 9.3.x-dev
Issue summary: View changes
Status: Needs work » Closed (cannot reproduce)
Issue tags: +Bug Smash Initiative

I tested this on 9.3.x and was not able to reproduce this error. I created menu links to

and both worked just fine, no errors.

Therefore, closing as cannot reproduce. If you are experiencing this problem reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").

Thanks!