Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emptying the MODX trash can corrupt values in modx_site_tmplvar_contentvalues #56

Closed
andrewcsp opened this issue May 4, 2012 · 0 comments

Comments

@andrewcsp
Copy link

Please see here for full details:
http://forums.modx.com/thread/76315/data-going-missing-in-modx-site-tmplvar-contentvalues

In particular, please read the 5th post for a partial (but not perfect) fix:
http://forums.modx.com/thread/76315/data-going-missing-in-modx-site-tmplvar-contentvalues#dis-post-422404

In short, the removeLanguageLinksToResource function is not careful enough when it updates the values of modx_site_tmplvar_contentvalues.

The following line of code can potentially retrieve any rows from modx_site_tmplvar_contentvalues including Date TV's or standard Text TV's which happen to contain a number matching $resourceId:
$templateVarResources = $this->modx->getCollection('modTemplateVarResource', array('value:LIKE' => '%:'.$resourceId.'%'));

Even if this function was limited to only operate on values belonging to Babel's TV, there is still the issue that $resourceid must exactly match the values found.

For example: removeLanguageLinksToResource(38) would update all four of these modx_site_tmplvar_contentvalues values (below), even those the last two do not relate to doc 38.

web-fr:91;web:38
web:38;web-fr:91
web:138;web-fr:261
web-fr:261;web:138

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants