You are here:  » Global Filters Stopped Working


Global Filters Stopped Working

Submitted by ChrisNBC on Thu, 2015-09-17 15:51 in

Hi David,

Hope all is going well.

I wondered if you might be able to help me resolve an issue I have will a number of my sites.

As you may remember, I use a zzGlobalAfter filters to apply a final set of filters globally.. Most of the filters standardise the data so for example colours using 'scan and set v2' and ' Search and Replace RegExp'. I have noticed these filters no longer appear to be applied. The data loads perfectly other than this and all other filters are applied. I was going to populate the zzGlobalAfter data file to see if anything loads but I think this is disabled in the code? I wondered if you might be able to suggest an alternative way I can check if zzGlobalAfter feed is even run or what else might be causing this? It's an area of the code I do not recall changing for quite a while so I'm a bit puzzled what's causing it.

Thanks in advance
Regards
Chris

Submitted by support on Thu, 2015-09-17 16:34

Hi Chris,

I looked back through the files modified to implement this, and as long as you are seeing the zzGlobalAfter "dummy" feed in /admin/, and you are able to click Filters and then add / edit as required they should be executed - it doesn't rely upon valid data being present in the feed - the contents should just be:

ProductName,BuyURL,Price
,,,

If that all looks OK, the only other relevant section of code is where the filters are loaded as each feed is imported. In the last includes/admin.php that I have from you in email, this is implemented via this modification at line 577:

$sql = "SELECT * FROM `".$config_databaseTablePrefix."filters` WHERE filename='".database_safe($admin_importFeed["filename"])."' OR filename='' OR filename='zzGlobalAfter' ORDER BY filename,created";

If that has become misplaced as a result of upgrades, the line appears within the admin_importSetGlobals() function of includes/admin.php, look for the original code:

    $sql = "SELECT * FROM `".$config_databaseTablePrefix."filters` WHERE filename='".database_safe($admin_importFeed["filename"])."' OR filename='' ORDER BY filename,created";

...and REPLACE with the above and that should be all it is.

If that all looks in place however, email me your latest includes/admin.php and I'll check it out further for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by ChrisNBC on Thu, 2015-09-24 22:11

Hi David,

Thanks for your quick response. Apologies for the delay in replying. The code was complete so I checked everything again and noticed a single filter missing which prevented all the others following it from having any effect...so it's now resolved...nothing to do with PT...it was self inflicted!!

Thanks again for your help.

Best regards
Chris