modxcms / Redirector

Handles all your site redirects in MODx Revolution.
https://docs.modx.com/current/en/extras/redirector/index
8 stars 21 forks source link

Redirector filling MODX error log #46

Closed lukemcd closed 9 years ago

lukemcd commented 9 years ago

When I check the error log for my site I am seeing multiple errors like this constantly being added: [2014-12-10 17:37:44] (ERROR @ /index.php) Error parsing condition with key 0: ('apple-touch-icon-120x120-precomposed.png' REGEXPmodRedirect.patternOR 'apple-touch-icon-120x120-precomposed.png' REGEXP CONCAT('^',modRedirect.pattern, '$'))

The forum has a post on the issue: http://forums.modx.com/thread/91434/decipher-revo-error

The issue is occurring for me with MODX 2.3.1 and Redirector 2.0.5. I do not know if the issue was happening prior to updating to MODX 2.3.

ralansbc commented 9 years ago

I am getting the same issue, with my error log filling up with Redirector errors. I am running ModX Revo 2.3.3 with Redirector 2.0.5-pl. In addition to all the error messages, Redirector seems to mess up my 404 Error message configuration. That is, when a wrong URL is typed in, the visitor gets directed to one of the pages I have set up in Redirector rather than my site error page. When I remove Redirector, the correct error page is displayed. Otherwise I love this plug-in and would love to see it work properly.

vierkantemeter commented 9 years ago

Perhaps this patch will solve your issues: https://github.com/modxcms/Redirector/commit/3d243760bfec6e84022d61e821ab5bd29678d9d3

MODX 2.3.3 and redirector 2.0.5 are working great over here when this patch is applied.

bertoost commented 9 years ago

The problem is that xPDO checks which operators are in the MySQL conditions. Since Redirector uses MySQL's REGEXP method to match patterns, and this one isn't in the validators list, it will fail for that line.

_Two workarounds @modxcms _

1) Add "REGEXP" to the list of valid operators

2) Add "modRedirect.pattern = '" . $search . "' OR " just before the REGEXP statements, so xPDO will see the "=" sign, which is valid, and will add the condition. This works for me.

bertoost commented 9 years ago

Fixed in update 2.0.6, coming soon!