Hello,
I installed the module on a Drupal 7 site, I could create meta tags and they appear well in the html code. But, I could not edit or remove them: all links give an error 404 page.
After looking a bit, I identified the problem: the links "edit" or "remove" are using simplified urls while my site does not. I can manage manually, but it is not ideal. Did I missed something?
Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kalanh’s picture

Clean URL's are not too difficult to set up, and once enabled have no down side. Follow the guide here:
https://www.drupal.org/getting-started/clean-urls

In fact, there are positive SEO effects for your site. According to SEOmoz:

Avoid the use of parameters, if possible.

http://moz.com/learn/seo/url

hansyg’s picture

Assigned: Unassigned » hansyg
Status: Active » Needs work

@patch-works does @kalanh answer make sense? clean-urls can be enabled here Administer > Configuration > Search and metadata

patch-works’s picture

Hello,
Thanks for tip, but some hosting do not allow the activation of clean URLs.
I also remember having had strange behavior after activating clean URLs several time after a webiste has started (thus already had content and links).
I will evaluate the option to activate clean urls for this site (seems the hosting could accept it), but as said before, I can manage manually.
Still, being able to take both situations into account would be a nice to have for the module.
Thank you for your work!

hansyg’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

davidsheart02’s picture

Status: Closed (fixed) » Active

This is actually an issue with clean urls on as well. If the site is located in a subfolder it breaks. For example, if a site lives at www.mydomain.com/awesome, clicking the edit button would take us to www.mydomain.com/admin/config/search/custom_meta/edit/1 instead of www.mydomain.com/awesome/admin/config/search/custom_meta/edit/1 which would then give the 404.

The url structure of the Edit/Remove buttons should be more flexible to prevent this from occurring.

davidsheart02’s picture

I'm guessing there's a better way to do this, but one way to patch things would be to change line 66 in custom_meta.admin.inc from this:

'#markup' => '&lt;meta ' . check_plain($meta_tag['meta_attr']) . '="' . check_plain($meta_tag['meta_attr_value']) . '" content="' . check_plain($meta_tag['meta_content']) . '"&gt; <div class="actions"><a href="/admin/config/search/custom_meta/edit/' . check_plain($meta_tag['meta_uid']) . '">Edit</a> | <a href="/admin/config/search/custom_meta/remove/' . check_plain($meta_tag['meta_uid']) . '">Remove</a>',

to this:

'#markup' => '&lt;meta ' . check_plain($meta_tag['meta_attr']) . '="' . check_plain($meta_tag['meta_attr_value']) . '" content="' . check_plain($meta_tag['meta_content']) . '"&gt; <div class="actions"><a href="custom_meta/edit/' . check_plain($meta_tag['meta_uid']) . '">Edit</a> | <a href="custom_meta/remove/' . check_plain($meta_tag['meta_uid']) . '">Remove</a>',

Since the only place those are listed is on the custom_meta config screen anyways, that relative address shouldn't cause huge problems...

davidsheart02’s picture

Ok. So, here's a possible patch. Using the l function which will be deprecated in 8 but is still considered standard for 7. Also updated the Cancel link on the edit form page that was suffering from the same issue as the edit and remove links.