Critical error error while processing a database query (not logged in) Critical error error while processing a database query (not logged in)
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Critical error error while processing a database query (not logged in)

Started by Mark7337, September 04, 2012, 01:07:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mark7337

I am testing my site as a visitor and when I click on "My Gallery" I get the error:
Critical error There was an error while processing a database query

Just to be clear I only get this error when I'm *not* logged in.

Here's the log info:

Sep 03, 2012 at 06:35 PM - While executing query 'SELECT cid FROM cpg15x_categories WHERE lft BETWEEN AND ' in include/functions.inc.php on line 54 the following error was encountered:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND' at line 1

Every other menu item works fine when I test as a visitor and I don't want a prospective member scared away from registering when they see that bit red critical error box. How can I fix that?

The site is http://dmuo.ravenofminoc.net
Screenshot: http://awesomescreenshot.com/097eynk17

Αndré

Please attach a screenshot of your group manager and post some information about installed plugins and any modification you applied.

Mark7337

Group Manager Screenshot:
http://awesomescreenshot.com/0abf2wx32

I haven't installed any plug-ins, here's the screenshot of that screen:
http://awesomescreenshot.com/0ecf2x1c4

A while back I did edit one of the files to insert the Google Ad code at the bottom of the site. I can't remember if I had the error before I did that. I might not have tested the site as a visitor at that point in the development.

Thanks for the help.


Mark7337

FYI The only file that I've edited directly is the template.html for the dark_velvet theme. I restored the original version, tested it and get the same error.

Αndré

For some reason the "My gallery" button is displayed to your visitors. I wasn't able to reproduce that behavior in my testbed (that button is never displayed to visitors). Please enable debug mode for all, so I can compare your debug output with the one in my testbed.

Mark7337

I have enabled debug mode for everyone. I'll check back later today.

Also, another quirk and I haven't searched the forums yet - but after logging into a new account and uploading the first picture/batch the user gets logged out. When they log back in, they are at the editpics.php screen. After the first logon, there are no issues. I'll search around for answers to that but I thought I'd include that here in case it's related to my other issue.

Thanks.

Αndré

Quote from: Mark7337 on September 07, 2012, 12:27:33 PM
after logging into a new account and uploading the first picture/batch the user gets logged out.
That's because you access the gallery with another URL than set in the config (http://dmuo.ravenofminoc.net vs. http://ravenofminoc.net). Please search the boards for more detailed information. There's also a section in the bridging docs how to create a redirection rule.

I'll have a look at the topic issue later.

Mark7337

Quote from: Αndré on September 07, 2012, 08:45:36 PM
That's because you access the gallery with another URL than set in the config (http://dmuo.ravenofminoc.net vs. http://ravenofminoc.net). Please search the boards for more detailed information. There's also a section in the bridging docs how to create a redirection rule.

Αndré, that did the trick. Since I was already replying to your previous message I kinda tossed that in but I'll behave myself and do my research before I ask a question from now on. Thanks.

The original issue is still there. I'll check back later to see if you need any more info from me.

Αndré

For some reason the value can_create_public_albums is 1 in your gallery. I'll investigate as soon as possible.

Αndré

Quote from: Αndré on September 10, 2012, 03:01:05 PM
the value can_create_public_albums is 1

It's 1 if you allow a specific user group (here, the guest group) to create public albums. You can enable/disable this in the category manager. However, I also enabled this in my testbed but the "My gallery" button is still doesn't displayed. I'll investigate further.

Αndré

Quote from: Αndré on September 12, 2012, 02:46:37 PM
the "My gallery" button is still doesn't displayed
Seems that some plugin removed it. After disabling the plugin engine it's also there.

There are now two possibilities:
1. Hide the button for guests
2. Fix the error message and display all pictures uploaded by guests*

I currently don't know what the docs say or what will be more logical.


* to fix it, open include/functions.inc.php, find
} elseif ($cat > FIRST_USER_CAT) {
and replace with
} elseif ($cat >= FIRST_USER_CAT) {
at two locations. Please report if it fixes the error message.

Αndré

After thinking about both options, option 2 is nonsense, as there is no user gallery for guests. The above code change will fix the error message, but won't show anything.

Αndré


Mark7337

Quote from: Αndré on September 13, 2012, 11:26:03 AM
Button has been removed in SVN revision 8500.

Thanks. This is my first install so I'm not sure what I need to do next. I read the revision notes, should I download the new .PHP files and upload/copy them over the existing ones?

Αndré

Check if your theme's theme.php file contains the following line:
if (!USER_CAN_CREATE_ALBUMS) {

If so, replace it with
if (!USER_CAN_CREATE_ALBUMS || !USER_ID) {

If not, apply that change to include/themes.inc.php.

Mark7337

Quote from: Αndré on September 14, 2012, 10:08:32 AM
Check if your theme's theme.php file contains the following line:
if (!USER_CAN_CREATE_ALBUMS) {

If so, replace it with
if (!USER_CAN_CREATE_ALBUMS || !USER_ID) {

If not, apply that change to include/themes.inc.php.

Αndré, sorry about the delay getting back to you. I edited /include/themes.inc.php as you directed and that fixed the problem. Thank you for your help!