PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Photopost Pro Bug Reports (http://www.photopost.com/forum/photopost-pro-bug-reports/)
-   -   SQL Error: Unknown column 'notcat' in 'where clause'(FIXED) (http://www.photopost.com/forum/photopost-pro-bug-reports/116320-sql-error-unknown-column-notcat-where-clause-fixed.html)

qwk98gt October 21st, 2005 08:29 AM

SQL Error: Unknown column 'notcat' in 'where clause'(FIXED)
 
Hey guys...

I've installed a fresh copy of PhotoPost 5.21 on a clean database for a new project, and got the following error while trying to move a category from beneath one parent to under another parent category.

Code:

Content visible to verified customers only.
Any idea why this might be happening and what I can do to fix it?

qwk98gt October 21st, 2005 08:33 AM

Ok, something just occurred to me within 5 seconds of posting that question which may help out. I believe that this is a bug in the PhotoPost code.

1. If the NEW parent category is set to "Contains Thumbnails? = No" and the category you are moving beneath it is set to "YES" then the error is generated and the category is bumped up as a new top-level category.

2. If you temporarily set the NEW parent category to "Contains Thumbnails? = Yes" you can move the child category beneath it w/o an error being generated. Then you can go back to the new parent category and set "Contains Thumbnails? = No".


It seems that there ought to be some logic in the PHP code that lets a child category containing thumbnails to be moved beneath a parent category tha does NOT contain thumbnails. Many of us have our galleries set up like this with empty parent categories for the sole sake of having a hiearchy that looks more like our forums hiearchy.

If that makes sense. :)

Chuck S October 21st, 2005 09:10 AM

well way before we get to any query stuff we kill the process so why not on yours? If I set a category to no thumbs I get a screen that says you cant upload to that category don't you?

if ( $category == "notcat" ) {
diewell( $Globals['pp_lang']['topcat'] );
}

qwk98gt October 21st, 2005 09:40 AM

I'm not sure if this happens on my installation or not.

Chuck S October 21st, 2005 09:53 AM

Well try uploading to the category that is marked no thumbs and sees what happens.

Your reporting that you get an SQL ERROR and I am saying I get a diewell message and you should as well which kills the page before any queries can run

qwk98gt October 21st, 2005 11:06 AM

Yes, if I try to upload directly to the parent category, then I get the error dialog box that says the category that I have chosen is a top level category.

But why would this matter if I was trying to move a child category into that parent category?

qwk98gt October 21st, 2005 12:47 PM

Thanks, Chuck. That seems to have worked perfectly. Is this something that you will talk to Michael about incuding in future releases, or should I be prepared to make similar edits to the code in the future?

Chuck S October 21st, 2005 01:08 PM

Hello

This is a proposed fix that simply replicates the catmoveopt into a mini function in adm-inc.php and we then call admoveopt which does not set catoptions variable with no thumbs to NOTCAT.

The main function in pp-inc.php needs this code to function on the front end. It is safe to run this

Michael will look over my proposed fix as always and either use it or may find another resolution but no worries the issue will be fixed one way or another.

qwk98gt October 21st, 2005 01:56 PM

Thanks again.

Michael P October 21st, 2005 02:16 PM

Actually, all that needs to be done is the line in pp-inc.php at 1705:

Code:

Content visible to verified customers only.
I already coded in the $nothumbs parameter (and use it in the adm-cats), just didn't finish it out on that line.

qwk98gt October 21st, 2005 02:37 PM

Thanks, Michael. I'll give that a shot.


All times are GMT -5. The time now is 07:07 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97