To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #436 (closed defect: fixed)

Opened 20 months ago

Last modified 16 months ago

a_page route won't work with additional parameters

Reported by: NikoViitala Owned by: tboutell
Priority: major Milestone: 1.4.2
Component: apostrophePlugin Version: 1.4
Keywords: route, a_page, sf_culture Cc:
Symfony version: 1.4

Description

Adding /:sf_culture to the start of the a_page route will break the system.

a_page:
  url:   /:sf_culture/:slug
  param: { module: a, action: show }
  requirements: { sf_culture: (?:en|es|ru|fi), slug: .* } 

sends error:
"The '/:sf_culture/:slug' route has some missing mandatory
parameters (:sf_culture)."

The problem is in plugins/
apostrophePlugin/lib/model/doctrine/PluginaPageTable.class.php on line 299. generate method needs all parameters to be passed.

Change History

Changed 20 months ago by boutell

  • status changed from new to accepted
  • version set to 1.4
  • milestone set to 1.4.1

Changed 17 months ago by tboutell

  • owner changed from boutell to tboutell

Changed 16 months ago by tboutell

  • status changed from accepted to closed
  • resolution set to fixed

This is fixed in [2496]

Resolves #436

Something for the I18N folks:

You can now put :sf_culture in the a_page route if you wish, like so:

a_page:

url: /:sf_culture/:slug
param: { module: a, action: show }
requirements: { slug: .* }

This allows Google to index separate pages for separate languages and allows links to language-specific pages to be shared by users, etc.

This leads to the question, "how does Google ever see the home page in a language other than English?" Our default language switcher just changes the user's culture and redirects to the home page without a culture in the URL. But you can also access culture-specific homepages at:

/de/
/en/
/fr/

Etc.

Consider removing the standard "homepage" route and replacing it with an action that redirects to the home page URL for the default language.

Note that we have not attempted to internationalize slugs.

Thanks to Niko Viitala (sorry Niko, I didn't at first realize from your ticket that it was such a simple change or I would have done this sooner).

Note: See TracTickets for help on using tickets.