The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Plugins bug within serendipity_event_dashboard...maybe

Creating and modifying plugins.
bernd_d
Regular
 
Posts: 376
Joined: Thu Jun 03, 2010 9:28 am

Postby bernd_d » Fri Dec 30, 2011 10:05 am

Hi!

Even if there is an comment, waiting vor approval within comments-section, it isn't shown in dashboard :(

2011-12-30_085849.png
2011-12-30_085849.png (7.27 KiB) Viewed 1185 times


2011-12-30_090235.png
2011-12-30_090235.png (4.87 KiB) Viewed 1185 times


serendipity_event_dashboard version 0.6.2
Serendipity 1.6

User avatar
mattsches
Regular
 
Posts: 425
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany

Postby mattsches » Sat Dec 31, 2011 5:47 pm

First of all, please check the "Number of pending comments to show" in your plugin settings and make sure it's greater than 0.

I've been looking at the plugin source code and maybe found the problem. But I need to ask other developers for help: What are the possible values for the status field in the comments table? Or, the other way round: What does a status = 'confirm' mean? And are there any more values besides 'approved', 'pending', and 'confirm'?

Garvin? :wink:

User avatar
garvinhicking
Core Developer
 
Posts: 29521
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Sat Dec 31, 2011 6:33 pm

Hi!

I believe approved, pending and confirm are the only ones. Approved comments are shown; pending are hidden and waiting for moderation. "confirm" is similar to pending, but means not the admin/owner of the blog needs to confirm, but the comment author himself.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
mattsches
Regular
 
Posts: 425
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany

Postby mattsches » Sat Dec 31, 2011 6:59 pm

Ok, thanks Garvin, this could be the problem here. I will commit a fix later (or next year :roll: ).

Oh, and one more thing: Looking at serendipity_fetchComments I found the following code
Code: Select all
              ORDER BY
                    " . ($where != '' ? '' : 'co.id') . " " . ($order != '' ? $order : '') . "

$order and $where are both passend to the function as parameters. However: If $order is an empty string, but $where isn't, the resulting SQL will be invalid, right?
Code: Select all
SELECT ... FROM ... WHERE ... ORDER BY;

bernd_d
Regular
 
Posts: 376
Joined: Thu Jun 03, 2010 9:28 am

Postby bernd_d » Mon Jan 02, 2012 2:17 pm

Thank you for your answers :) So i'll wait for an update of dashboard.

User avatar
garvinhicking
Core Developer
 
Posts: 29521
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Jan 02, 2012 5:26 pm

Hi!

I believe the code currently suggest that order can only be used, if where is also used...

Regard,s
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
mattsches
Regular
 
Posts: 425
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany

Postby mattsches » Tue Jan 03, 2012 8:30 pm

bernd_d wrote:Thank you for your answers :) So i'll wait for an update of dashboard.

Ok, I committed the update, it should be available via Spartacus tomorrow. If it doesn't fix your problem, please do tell :wink:

User avatar
blog.brockha.us
Regular
 
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany

Postby blog.brockha.us » Tue Jan 03, 2012 10:30 pm

garvinhicking wrote: believe the code currently suggest that order can only be used, if where is also used...

I stumbled on the same part of code. It is in fact the case, that $order is ignored if no $where is given, what seemed wrong to me, as you may want to order by date ASC or DESC in example but don't need no $where.. (well I wanted this.. ;))
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/

User avatar
blog.brockha.us
Regular
 
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany

Postby blog.brockha.us » Wed Jan 04, 2012 1:06 am

Code: Select all
              ORDER BY
                    " . ($where != '' ? '' : 'co.id') . " " . ($order != '' ? $order : '') . "


Uh.. :shock:
If $where and $limit is set, but $order not, this produces:
ORDER BY LIMIT ..

That is wrong (and not understandable) code. I guess it should be

Code: Select all
              ORDER BY
                    " . (empty($order) ? 'co.id' : $order) . "


Order should not be related to where and I think the code above is a copy and paste error. Perhaps the author wanted
Code: Select all
              ORDER BY
                    " . ($order != '' ? '' : 'co.id') . " " . ($order != '' ? $order : '') . "


.. what produces correct output but is way too complicated.
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/

User avatar
garvinhicking
Core Developer
 
Posts: 29521
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Jan 04, 2012 11:18 am

Hi!

That sounds about right, thanks for looking. %-)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/



Return to Plugins

Who is online

Users browsing this forum: No registered users and 1 guest

cron