XenForo XenSoluce - SEOOptimization-2.5.0 - Fix Problem when we edit thread, delete all meta info

nomada

Registered
Hi, first thanks for the sharings. :)
I will share the solution for the problem of XenSoluce - SEOOptimization-2.5.0. When you edit one thread, all meta information is deleted. This solution was created for me.
1 - Found the file:
src/addons/XenSoluce/SEOOptimization/_data/template_modifications.xml
look for xs_seo_thread_edit and after the last </modification> put this code:
XML:
<modification type="public" template="post_edit" modification_key="xs_seo_thread_edit1" description="Adicionar SEO Quando editamos" execution_order="10" enabled="1" action="str_replace">
    <find><![CDATA[<xf:formrow rowtype="{{ $quickEdit ? 'fullWidth noLabel mergePrev' : '' }}">]]></find>
    <replace><![CDATA[
<xf:if is="$xf.visitor.canEditSeoOwnEntity($thread)">
    <xf:macro template="xs_seo_macros_invisivel" name="meta" arg-data="{$thread}" />
</xf:if>$0]]></replace>
  </modification>
save and close this file.

2 - Found the file
src/addons/XenSoluce/SEOOptimization/_data/templates.xml
look for arg-output="{$output}" /></xf:macro>]]></template> and that code put this code:
XML:
<template type="public" title="xs_seo_macros_invisivel" version_id="2050100" version_string="2.5.1"><![CDATA[<xf:macro name="meta" arg-data="!">
<xf:js src="XenSoluce/SEOOptimization/char_counter.js" />
<xf:css src="xs_seo.less" />
  
<xf:textbox type="hidden" name="xs_seo[meta_title]" value="{$data.xs_seo.meta_title}" />
<xf:textarea name="xs_seo[meta_description]" value="{$data.xs_seo.meta_description}" rows="3" style="display:none;" />
<xf:textbox type="hidden" name="xs_seo[meta_robots]" value="{$data.xs_seo.meta_robots}" />
<xf:textbox type="hidden" name="xs_seo[open_graph]" value="{$data.xs_seo.open_graph}" /> 
<xf:textbox type="hidden" name="xs_seo[twitter_card]" value="{$data.xs_seo.twitter_card}" /> 
<xf:textbox type="hidden" name="xs_seo[canonical_url]" value="{$data.xs_seo.canonical_url}" /> 
</xf:macro>

<xf:macro name="image_url" arg-data="!" arg-output="{{ false }}">
    <xf:set var="$meta">
        <meta property="og:image" content="{{ change_open_graph($data, base_url(property('publicMetadataLogoUrl'), true)) }}" />
        <meta property="twitter:image" content="{{ change_open_graph($data, base_url(property('publicMetadataLogoUrl'), true)) }}" />
        <meta property="twitter:card" content="{{ ($data.xs_seo.twitter_card != 'summary') ? $data.xs_seo.twitter_card : $xf.options.xs_seo_twitter_card }}" />
    </xf:set>
    <xf:macro template="metadata_macros" name="output" arg-option="meta_image_url" arg-meta="{$meta}" arg-output="{$output}" />
</xf:macro>]]></template>
save and close the file.

3 - Remove this two files from the file hashes.json located in bin of addon. This action is for not give you the scan error, because you edit files.
4 - Go to Addons in admin panel, and rebuild the addon XenSoluce - SEOOptimization-2.5.0. And the problem is solved. ;)
 
  • Tags
    xensoluce - seooptimization-2.5.0
  • Back
    Top Bottom