0

my route

   amu_hal.publicationsPerYear:
      path: '/publications/{year}/{url}'
      defaults:
        _controller: '\Drupal\amu_hal\Controller\AmuHalController::publicationPerYear'
        _title: 'publicationPerYear'
        year: 2016
        url: 'default url'
      requirements:
        _permission: 'access content'

that type of request

http://my_site/publications/2016/my_encoded_url

gives

The requested page could not be found.

and does not enter

   class AmuHalController extends ControllerBase {
           public function publicationPerYear($year,$url) {

this

http://my_site/publications/2016/hallo

does enter into my controller action

but this not:

 http://my_site/publications/2016/https%3A%2F%2Fmy_webservice%2Fsearch%2F%3Frows%3D5%26sort%3DproducedDate_tdate%2Bdesc%26fl%3Dtitle_s%2Cen_title_s%2Clabel_s%2Cen_label_s%2CdocType_s%2CauthIdHal_s%2ChalId_s%2CstructId_i%2Curi_s%2Ckeyword_s%2Cen_keyword_s%2CauthLastNameFirstName_s%2CjournalTitle_s%26fq%3DauthFullName_t%3A(%22M.+trump%22+OR+%22donald+trump%22)
  • 1
    As far as Drupal's concerned I think the route you're requesting is actually /publications/2016/https:/<empty string>/etc.... Since there's no route defined for /publications/2016/https: and upwards, and given that automatically passing of extra arguments has been dropped I'm not sure there are any options. Apart from just using a query string, of course – Clive Feb 22 '17 at 11:24
  • thanks Clive. can u explain how to modify my code to use a query string? – Matoeil Feb 22 '17 at 11:29
  • Looks like you got that sorted with a new question? – Clive Feb 22 '17 at 18:54
  • i cannot hide anything from u :) – Matoeil Feb 23 '17 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.