Support from Acquia helps fund testing for Drupal Acquia logo

Comments

heyyo created an issue. See original summary.

DamienMcKenna’s picture

Version: 7.x-1.14 » 7.x-1.x-dev
Category: Bug report » Support request
Status: Active » Fixed

Looking at the page both the 'description' and 'og:description' tags show the same content:

[[{"fid":"2113","view_mode":"default","type":"media","attributes":{"height":"557","width":"600","class":"media-element file-default"}}]]  

The problem here is that you have an embedded media object at the beginning of the content. You might need to override the 'token' view mode for that content type and make sure the Media filter is enabled.

DamienMcKenna’s picture

Category: Support request » Feature request
Status: Fixed » Needs review
FileSize
657 bytes

OTOH, maybe we could automatically filter out media strings?

DamienMcKenna’s picture

This patch adds a test for integration with the Media WYSIWYG module from the current Media 7.x-2.x codebase.

DamienMcKenna’s picture

So because the patch in #4 is adding a new test dependency it won't work, so it needs to be split into two pieces - first the test dependencies, then the other changes. This covers the test dependencies.

The last submitted patch, 4: metatag-n2700217-4.patch, failed testing.

The last submitted patch, 4: metatag-n2700217-4.patch, failed testing.

  • DamienMcKenna committed 3eac095 on 7.x-1.x
    Issue #2700217 by DamienMcKenna: Added Media module as a test dependency...
DamienMcKenna’s picture

Now that the test dependencies have been added, lets go for the rest of the patch.

heyyo’s picture

Thanks for this really quick reply !
I just applied your patch from the #9, but now my meta description and og:description are empty.

  • DamienMcKenna committed d788ca3 on 7.x-1.x
    Issue #2700217 by DamienMcKenna: Automatically filter out Media embed...
DamienMcKenna’s picture

@heyyo: Yes, that's because the initial part of the node body field only contains a Media embed code.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed.

DamienMcKenna’s picture

@heyyo: You should try updating the 'summary' field for that node so it has actual text and not just a Media embed code.

heyyo’s picture

Ok thanks I understand. But I was looking for an automatic way.
I never understood what was the purpose of the View Mode Tokens. I tried to use is but without success.
I have the module Smart Trim enabled. Unfortunately the usage of the Token View mode, and smart trim on the body field, which could filter HTML tags, doesn't do anything. The node:summary is still empty.

So I supposed I need to look on how to write a custom token which I will use instead of node:summary.
Or maybe there is a way to alter node:summary, which will fix its length only after removing media tags and html tags.

DamienMcKenna’s picture

Maybe try customizing the 'body' field in the Tokens view mode, then changing the token to "[node:body]"?

heyyo’s picture

Thanks Damien for your time. This is what I did. I'm not using node:summary but node:body.
I didn't use view mode of token but custom code to trim the node:body token.

Status: Fixed » Closed (fixed)

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

mgzrobles’s picture

I don't think this issue is fixed only with "media_wysiwyg_filter" because you can use that format only with media and custom code.
I think is better use something like this

module_load_include('inc', 'media', 'includes/media.filter');
$value = media_filter($value);