Advanced search  

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

Pages: [1]   Go Down

Author Topic: Critical error error while processing a database query (not logged in)  (Read 30834 times)

0 Members and 1 Guest are viewing this topic.

Mark7337

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical error error while processing a database query (not logged in)
« Reply #1 on: September 04, 2012, 12:22:47 pm »

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

Mark7337

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Critical error error while processing a database query (not logged in)
« Reply #2 on: September 05, 2012, 02:46:52 am »

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.

Logged

Mark7337

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Critical error error while processing a database query (not logged in)
« Reply #3 on: September 05, 2012, 03:00:50 am »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical error error while processing a database query (not logged in)
« Reply #4 on: September 05, 2012, 09:25:38 am »

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.
Logged

Mark7337

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Critical error error while processing a database query (not logged in)
« Reply #5 on: September 07, 2012, 12:27:33 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical error error while processing a database query (not logged in)
« Reply #6 on: September 07, 2012, 08:45:36 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.
Logged

Mark7337

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Re: Critical error error while processing a database query (not logged in)
« Reply #7 on: September 07, 2012, 10:06:57 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical error error while processing a database query (not logged in)
« Reply #8 on: September 10, 2012, 03:01:05 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical error error while processing a database query (not logged in)
« Reply #9 on: September 12, 2012, 02:46:37 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Re: Critical error error while processing a database query (not logged in)
« Reply #10 on: September 12, 2012, 03:34:20 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
Code: [Select]
} elseif ($cat > FIRST_USER_CAT) {and replace with
Code: [Select]
} elseif ($cat >= FIRST_USER_CAT) {at two locations. Please report if it fixes the error message.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical error error while processing a database query (not logged in)
« Reply #11 on: September 13, 2012, 11:19:47 am »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical error error while processing a database query (not logged in)
« Reply #12 on: September 13, 2012, 11:26:03 am »

Button has been removed in SVN revision 8500.
Logged

Mark7337

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Re: Critical error error while processing a database query (not logged in)
« Reply #13 on: September 14, 2012, 12:30:59 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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical error error while processing a database query (not logged in)
« Reply #14 on: September 14, 2012, 10:08:32 am »

Check if your theme's theme.php file contains the following line:
Code: [Select]
if (!USER_CAN_CREATE_ALBUMS) {
If so, replace it with
Code: [Select]
if (!USER_CAN_CREATE_ALBUMS || !USER_ID) {
If not, apply that change to include/themes.inc.php.
Logged

Mark7337

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Re: Critical error error while processing a database query (not logged in)
« Reply #15 on: September 20, 2012, 02:45:58 am »

Check if your theme's theme.php file contains the following line:
Code: [Select]
if (!USER_CAN_CREATE_ALBUMS) {
If so, replace it with
Code: [Select]
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!
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 20 queries.