Closed (fixed)
Project:
Simple Meta
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2012 at 13:30 UTC
Updated:
20 Oct 2014 at 18:14 UTC
Jump to comment: Most recent
After first use of module (after changing of homepage title) all titles of nodes lost all their titles. If before using module they were looking like Node Title|Site Name, now they are looking as the new homepage title that I've just created.
And it wasn't caused on pages, only on my custom content types.
Is it possible to fix it? It's very important for me. I have a lot of node on whose I don't need to change the title.
I thought it because I use the default drupal homepage, but after creating homepage with Views, the problem is still here.
Comments
Comment #1
antongp commentedHi. Thank you for your issue report.
It is possible to use "patterns" for paths so one meta config will be applied for several pages. For example, if you'll set path "node/%" for some meta config (it's possible to set path manually on admin pages, "popup" form will set meta for current page only), it'll be applied to all pages which start from "node/" (for example, node/10. But not for "node"). Furthermore more particular paths will override more general so if you'll set some meta for "node/%" and "node/15" 2nd config will be used on "node/15".
Problem is that menu_get_ancestors() function is used to get right meta setting for page. In your case you have meta setting for path "node" (default Drupal frontpage) which menu_get_ancestors() returns as ancestor of any "node/*" path so this meta applied to any node page if there is no setting for more particular path. You should remove setting for "node" path for now, it'll help you with meta on nodes.
So menu_get_ancestors() is not the best way to generate ancestors for Simple Meta. This will be fixed soon.
Comment #2
mikaoelitiana@gmail.com commentedIn waiting for the correction, I have juste disabled the ancestor when querying the meta from database. I have alterated the simplemeta_get_page_meta() fonction not to use ancestor so I have something like this :
->condition('s.path', array($path), 'IN')instead of
->condition('s.path', $ancestors, 'IN')I think a setting option should be added to let user choose to use ancestors or not
Comment #2.0
mikaoelitiana@gmail.com commentedadditional info
Comment #4
antongp commentedmenu_get_ancestors() function was not much appropriate to try to retrieve meta config for the page, now it is replaced by custom function which is defined in the SimpleMeta module and have a few differences in comparison with menu_get_ancestors().
So, menu_get_ancestors() returns such list:
New custom function returns such list:
- paths that are shorter (in parts meaning) than original path end with %
Comment #5
antongp commentedFixed in 7.x-2.2