Comments

msmithcti’s picture

StatusFileSize
new1.13 KB
damienmckenna’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, metatag-feeds-integration-1859136-2.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new1.13 KB

This might work better.

multpix’s picture

#4 works well

do not forget to comment out the line 15 - who is without devel

msmithcti’s picture

StatusFileSize
new1.11 KB

@DamienMcKenna - Do you have a link to somewhere that explains creating patches with new files?

@multpix - Thanks for spotting that! Here's an updated patch:

Status: Needs review » Needs work

The last submitted patch, metatag-1859136-feeds-integration-6.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new1.13 KB

Rerolled.

damienmckenna’s picture

@splatio: What you do is you "add" all changes you want, inc new files, and then "git diff HEAD" will show all changes against the latest code from upstream.

rohit.wadhwa’s picture

when i disable the devel module this patch is not working. please check this issue.
Not able to visit this link : http://[site_domain]/admin/structure/feeds/testimonials_importer/mapping/ for mapping fields.

multpix’s picture

StatusFileSize
new1.13 KB

need comment string with dpm($info);

Status: Needs review » Needs work

The last submitted patch, metatag-n1859136-8-0.patch, failed testing.

multpix’s picture

StatusFileSize
new499 bytes

ups

msmithcti’s picture

Status: Needs work » Needs review
StatusFileSize
new1.11 KB

Thanks for reminding me about this! This patch should apply and doesn't have a stray call to dpm() in it :)

rohit.wadhwa’s picture

No idea but still when we disable devel module this is not working. Not looking logical but can you test this case ?

siefca’s picture

Same here. I added include_once to enable it but no results. Seems the hook is not even called.

damienmckenna’s picture

Maybe it needs to be added to the main metatag.module file?

damienmckenna’s picture

Status: Needs review » Needs work

Feeds v2.0alpha4 mentions the following in the changelog:

- Added support for feeds hooks to be located in modulename.feeds.inc.

So in theory this should just work. Maybe the site caches need to be cleared after applying the patch?

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new63.49 KB

After applying the patch I get the following in the Feeds mapping page as options for the field target:
Metatag target options in the Feeds field mapper.

damienmckenna’s picture

Status: Needs review » Fixed

Committed, thanks for the contribution!

damienmckenna’s picture

StatusFileSize
new1.54 KB

A tiny follow-on patch to add some comments, rename the $type variable and tweak the formatting a little.

damienmckenna’s picture

Status: Fixed » Needs review
damienmckenna’s picture

Status: Needs review » Fixed

Committed.

damienmckenna’s picture

Status: Fixed » Reviewed & tested by the community
StatusFileSize
new699 bytes

This additional follow-up provides a slight improvement to the field names, it now says e.g. "Meta tag: Description" rather than "Metatag Description" and uses the meta tag's actual description field rather than just repeating the meta tag's label.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, metatag-n1859136-24.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review

#24: metatag-n1859136-24.patch queued for re-testing.

damienmckenna’s picture

Status: Needs review » Fixed

Committed. We're good for now.

pnigro’s picture

I am sorry to reopen this but I am getting some odd behaviors when testing Meta tags 7.x-1.x-dev (March 17th) with Feeds 7.x-2.0-alpha7. I added Meta: Keyword and Meta: Description to the feed mapping and set the processor to Update existing nodes. I then added the keyword and description data to a .csv file and imported it. The keyword data was added to the existing nodes, but the description data wasn't. It was still set to the default "[node:summary]". I also tried the Meta: Abstract field and it was empty after import. I double checked the names of the columns in the .csv file and they were correct.

Although the keyword field updates, it only updates when a node's initial keyword value is empty. If you try to update an existing keyword field then the field stays the same.

So to summarize:

  • Meta: Keyword only works when updating a node where the keyword field is empty
  • Meta: Description doesn't work
  • Meta: Abstract doesn't work

I have not tested the remaining Meta tag fields. If you need any more information please let me know.

Thanks
Paul

pnigro’s picture

Status: Fixed » Needs work

Forgot to set status

damienmckenna’s picture

Can you please check what data is added to the {metatag} table? The 'data' field should have something like:
a:1:{s:5:"title";a:1:{s:5:"value";s:33:"The title goes here | [site:name]";}}

damienmckenna’s picture

I ran a test import and it worked as expected, the values were inserted into the database correctly:
a:3:{s:11:"description";a:1:{s:5:"value";s:27:"It's a monkey's description";}s:8:"keywords";a:1:{s:5:"value";s:22:"Itsa, monkey, keywords";}s:5:"title";a:1:{s:5:"value";s:21:"It's a monkey's title";}}

Next to test updating the records.

damienmckenna’s picture

Status: Needs work » Active

Ok, I can confirm that the values are not updated correctly, but the initial records are at least correctly imported initially.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new808 bytes

I caught the problem - the old data was being stored in $entity->metatags[$langcode] while the new values were being stored in $entity->metatags as normal; this patch adjusts metatag_metatags_save so that it only uses the $entity->metatags[$langcode] values if there aren't any others to use.

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

damienmckenna’s picture

Status: Fixed » Closed (fixed)

Now that Metatag v7.x-1.0-beta5 is out am closing this to keep the issue queue clean.

pnigro’s picture

Status: Closed (fixed) » Active

Hello,

I tried updating only the meta keyword tags using Feeds and after import the meta tag descriptions, which were previously set, are now deleted. Steps to reproduce include the following:

  1. Create a node and set the meta keyword and description tags in node/edit
  2. Create a csv feed and set it to update existing nodes
  3. Add Node ID and Meta: Keyword mappings to the feed
  4. Create a csv file with the Node ID from step 1 and updated meta keywords
  5. Import feed
  6. Revisit node from step 1 to see meta keywords updated and meta description deleted

If you update both meta keyword and description tags at the same time, they both update. If you need any more information please let me know.

Thanks
Paul

plopesc’s picture

Status: Active » Needs review
StatusFileSize
new1.41 KB

Hello

pnigro was right. When you try to override only part of the metatag properties, it overrides full metatags object and poperties not defined in feed are removed.

Attaching a patch that loads the full metatag object when exists and override only new values.

Regards

plopesc’s picture

StatusFileSize
new838 bytes

Hello

Attaching improved patch.

Regards.

damienmckenna’s picture

Status: Needs review » Needs work

Unfortunately loading the existing entity's data is more complicated, you can't just use $entity->language anymore, you need to use metatag_entity_get_language().

plopesc’s picture

Status: Needs work » Needs review
StatusFileSize
new1.03 KB

Patch re-rolled following your suggestions.

Thanks for your support!

damienmckenna’s picture

StatusFileSize
new1.16 KB

I prefer using !empty($var) rather than just doing $var != 0.

plopesc’s picture

OK, it's good for me ;)

Only one question:

+++ b/metatag.feeds.inc
@@ -32,6 +32,22 @@ function metatag_feeds_set_target($source, $entity, $target, $value) {
+  if (!isset($entity->metatags) && !empty($entity->feeds_item->entity_id) && is_numeric($entity->feeds_item->entity_id)) {

Is necessary check if entity_id is numeric? I think this value are always numeric if not empty, but maybe I'm wrong.

Regards

damienmckenna’s picture

@plopesc: I haven't tested it yet to know what the $entity data structure is like at that point, it's just an added precaution.

plopesc’s picture

@DamienMcKenna: AFAIK, entiy_id is 0 if the entity is being created by feeds in that moment or the numeric entity_id if the entity is being edited by feeds ;)

kingandy’s picture

Patch from #33 does not appear to be present in 7.x-1.x-dev or 7.x-1.x-beta7 (both released after reported commit date). Is this something that's been reverted since?

damienmckenna’s picture

@kingandy: The code has since been improved so those lines don't appear exactly the way shown in that patch anymore. You might want to also review #2020565: Records for nodes have the wrong language value during initial creation.

kingandy’s picture

Ah, that makes sense, thanks! I'll move towards testing #41...

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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