Member
Member
stef404   2009-02-03, 22:51
#1

I am running ZP 1.2.2 within a WP 2.6.5 installation without any problems.

When I try to use ZP 1.2.3 with my customized theme I get the error:
Fatal error: Cannot redeclare has_filter() (previously declared in .../zp-core/functions-filter.php:185) in .../wp-includes/plugin.php on line 99
(note: ... is my installation path)

With my humble coding knowledge I can only guess that Wordpress uses the same function declaration. There are some lines in the plugin.php file.
Is anybody out there who can give me a helping hand to get rid of this error? I even don't know what this function is about
Thanks,
stef

Member
Member
amyg   2009-02-04, 23:26
#2

I'm getting this too.
I see that both WP and ZP have a function 'has_filter' also 'remove_filter'
I changed to zp functions to 'has_zpfilter' and remove_zpfilter'

SEEMS to be working, but hopefully a developer who knows what they're doing (I really don't) can weigh in.

Even if this doesn't break anything, it will be a pain for coming upgrades - so BEWARE before following my lead!!!
a

Administrator
Administrator
acrylian   2009-02-05, 10:55
#3

We might rename them later. Of course we cannot check every system (mostly it's Wordpress but not exclusively) that maybe is used with Zenphoto if it has similar named functions.

Your renaming might break something if those functions are called somewhere.

Member
Member
stef404   2009-02-05, 14:01
#4

Thanks for your reply.
Is there an easy way to replace all strings has_filter() and remove_filter()?

Member
Member
amyg   2009-02-05, 21:44
#5

stef404..
It's really simple, just open the files named in your error, scroll down to the line numbers mentioned and change the name. -you can also search and replace.

  • at the end of the end of the day, I did abandon this method (calling the wp header) due to the 404 issues mentioned in other forum topics. Disappointing, because otherwise, it worked beautifully.

acrylian... again, I'm no coder, but I wander if it would make sense to name all functions (at least the names that might be common)zp....

Member
Member
sbillard   2009-02-06, 01:42
#6

It looks like those functions are not used anywhere yet, so renaming them should not cause problems. The others--register_filter and apply_filter are used, so hope they are not causing problems.

We will rename the two to zp_has_filter() and zp_remove_filter()

Member
Member
stef404   2009-02-06, 08:53
#7

@sbillard: Great news.
I'm impressed by the fast response and helpful hints of the ZP development team.
Thank you very much. Great job!

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.