Since upgrading the the latest version of ZenPhoto my Akismet spamfilter plugin is throwing out the following error to my log file every time I try to post a comment
`[01-Sep-2011 21:34:12] PHP Catchable fatal error: Object of class _Image could not be converted to string in /home/kieran/public_html/gallery/zp-core/zp-extensions/spamfilters/akismet.php on line 454`
I'm happy to go about fixing the plugin (and pass the fix back to the community) but need some pointers as to what this error might be referring to
Comments
I have 2 web sites on 2 different hosters, both with the lastest official release 1.4.1.3.
with the 1st one (my old website of a not very good hoster), I don't have any problem with askismet
with the 2nd one (my official website but spammed), I have the same problem than KieranOShea
any idea about that issue ?
I think I would be a very good idea that zenphoto supports that plugin, usefull for most users
We did have a user once supporting that plugin, unfortunately that seems to have gone dormant. Zenphoto does support some simple spam filtering with its included filters. But we are not in a position to support more than those. {Note there are options other than askismet--perhaps you should try one of them?)
I think I have found the problem of the plugin.
the signature of the function filterMessage() has changed between 1.4 and 1.4.1.
1.4 and older :
function filterMessage($author, $email, $website, $body, $imageLink, $ip)
@param string $imageLink A link to the album/image on which the post was made
1.4.1 :
function filterMessage($author, $email, $website, $body, $receiver, $ip)
@param object $receiver The object on which the post was made
as the signature of the function filterMessage() of the akismet plugin has not changed, an object was sent in a string, causing the error message.
I do some tests before confirming that the problem is resolved and the spam filter working again
can you explain how to update the plugin for zenphoto 1.4.1 ?
maybe, create another plugin ?
the existing one is for 1.4 and older
the new one is for 1.4.1 and newer
maybe, it would be a good idea to change the title of the post ("existing plugin akismet doesn't work with 1.4.1" or something like that)
I am not sure what the use of this link is. The solutions I can see are either set the `$imageLink = '';` or to set it to `$imageLink = getTinyURL($imageLink);` at the beginning of the function.
Let us know what works and we will update the plugin on the site.
I have updated the akismet plugin for zenphoto 1.4.1 and more.
Is there a way to upload this release of the plugin ?
`foreach($this->comment as $key => $data) {
$query_string .= $key . '=' .urlencode(stripslashes($data)) . '&';
}`
to this
`foreach($this->comment as $key => $data) {
if (gettype($data) != 'object') {
$query_string .= $key . '=' . urlencode(stripslashes($data)) . '&';
}
}`
As I use this plugin and will continue to do so as I upgrade ZenPhoto into the future, I'll be happy to contribute back to ensure it keeps working.
my conclusion about the issue is the same that KieranOShea but the proposed correction is very simple :
I changed the signature of the function (to be compatible with other spam filters), but the object and ip parameters are simply ignored by the akismet plugin.
@acrylian :
1- as I am not the owner of the plugin, I prefer the plugin remains on the site zenphoto, but as I use it, I will do my best to keep working (as KieranOShea)
2- the latest update is not a rewrite with php5, but only the bug fix
before giving to the community, it would be better that others can test it and make feed back.
if you are OK about that, I will create a ticket with the package of this new plugin
like that, beta testers can try it before you give the plugin in the plugin section of zenphoto.
1- as I am not the owner of the plugin, I prefer the plugin remains on the site zenphoto, but as I use it, I will do my best to keep working
Well, the plugin is open source as is everything else so there will be no problem if you take over. The original developer of is not active regarding Zenphoto for several years. We just host it as an exception of the rule (we do with a few older plugins and themes) as it might be useful for someone to extend or improve. Just as you did.
2- the latest update is not a rewrite with php5
Didn't you say on the ticket that you switched to use a new php5 akismet class? Maybe I missunderstood. Anyway, since Zenphoto requires php 5+ now anyway that change would make sense.
- fix the issue on the actual plugin as describe above.
- rewrite the plugin for use the php5 askimet classes.
I will create a new ticket for this new plugin. Do want you what with it.
But, It would probably be my latest ticket.
I realy do not approve your reactions very closed.
We can not really participate in the development of zenphoto.
I am realy disappointed: I created two themes, I have detected many anomalies, I have suggested many improvements, I do a lot of pub for zenphoto forums on French.
I ask no reward, but just listening of a regular contributor.
I ask you to try to understand the needs of users.
but it seems you do not want my help...
You wish us to do literally unlimited implementation of your ideas even when we do not agree with them. Surely you can understand that we would not want to implement changes in which we do not believe! Specially since when push comes to shove, it will be we, the developers who have to support these changes, not you the suggestor. I still do not understand why you seem to insist that your change suggestions must only be part of the core rather than custom plugins for your own use as we have suggested.
You do provide some usefull updates, etc. But don't seem to want to step up and maintain them. We appreciate the updates, but you must understand that we are not in a position to maintain them ourselves. If no one maintains them they will become obsolete and useless. This is the nature of open source made by volunteers.
So, it seams that unless we totally agree with you we are un-helpful, un-responsive, and inconsiderate. I don't think so.
BTW, we also get no reward--strictly volunteer effort on all our parts. What little (and I do mean little) we get as contributions goes towards paying our hosting costs.
sorry to derive inital topic, but I hope you will understand.
"I still do not understand why you seem to insist that your change suggestions must only be part of the core rather than custom plugins for your own use as we have suggested".
It is a little bit difficult to explain my thought (english is not my natural language : with what I think in French and what I write in English, and what you understand: we have a lot of reasons not to understand ourselves, but we can try...)
I suggest you to have an improvement on printImageStatitic() and printRandomImage(). Of course, I need it to improve zpArdoise, but I think it may be used by everybody.
You have done half the job : with current improvement in 1.4.2, I can access to the full image and it is a good thing.
To be complete, I wish you to add an optionnal parameter to the signature of the function : if an optional class is in the call, then add this class to the tag wrapping the full image.
without that, the full image can't be easily be used.
when I write easily, I would say "by everyone"; of course I can do some jquery to add the class in some context, I can do a complex call to colorbox, but it's not quite simple for everyone else : so your improvement seems to be unusable.
you told me that I insist, but you don't realy explain to me why you don't want to add this realy simple optionnal parameter. it's realy easy to do, and I'm ready to code it if I can upload and commit the code.
"You do provide some usefull updates, etc. But don't seem to want to step up and maintain them".
I give two themes to the community and be sure I do my best to maintain them.
for plugin, it's something else: I did not create them and they use php code that I do not understand (I am absolutly not a php developper and some lines take hours).
I can easily correct easy anomalies, but in some cases, I am not good enough and I'm not so sure to be able to maintain them.
you do not want to keep the site zenphoto plugin, I can understand, but it is the right solution for maintenance by the community.
watch akismet : it was developed by thinkdreams and maintained by Kieran O'Shea and me.
if a plugin is abandonned, others may keep it, as you do it to the core components of zenphoto.
I think it's a way you should explore and encourage to develop the zenphoto community.
few developers could maintain the themes on each release of zenphoto.
same thing for the plugins.
"it seems that unless we totally agree with you we are un-helpful, un-responsive, and inconsiderate"
Of course not ! I realy think that zenphoto is a wonderfull tool to create photo gallery and that zenphoto team does a very good job.
but sometimes, you are a little bit "hard" with users. you can also try to understand it, and try to listen to the arguments that I can give you (or others can give you).
thanks to have read me...
"you do not want to keep the site zenphoto plugin" I do not think you really understand here. Any plugin maintained by someone else but kept on our site simply adds work for us. You can easily see by the fiasco of the askmet filter. There was confusion of what submission contains which fixes. There are two tickets that we have to deal with. And we have to package and provide the changes. This will happen every time a change is made. It is much better for all involved it these plugins, like your themes, reside on your server where you have control. The Zenphoto developers provide no value added here.
"you are a little bit 'hard' with users. you can also try to understand it, and try to listen to the arguments that I can give you" Well, when it is necessary to say that we wont fix someting five times we naturally get a little frustrated. Seems like we are beating our heads against a wall. Specially since there were statements about why the change was not needed ad what you should do instead. Seems to me more like it is you who won't listen to the arguments.