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

antongp’s picture

Hi. 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.

mikaoelitiana@gmail.com’s picture

In 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

mikaoelitiana@gmail.com’s picture

Issue summary: View changes

additional info

  • Commit 3d26545 on 7.x-1.x by antongp:
    Issue #1848628 by motomc: replaced use of menu_get_ancestors() by custom...
antongp’s picture

Issue summary: View changes

menu_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:

    node/12345/edit
    node/12345/%
    node/%/edit
    node/%/%
    node/12345
    node/%
    node

New custom function returns such list:

    node/12345/edit
    node/12345/%
    node/%/edit
    node/%/%
    node/%

- paths that are shorter (in parts meaning) than original path end with %

antongp’s picture

Status: Active » Fixed

Fixed in 7.x-2.2

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.