12-28-2016, 03:03 PM
No I have not made any changes to the db class.
The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Running Update Query
|
12-28-2016, 03:03 PM
No I have not made any changes to the db class.
12-28-2016, 03:05 PM
Ok. I'm seeing now. I don't think there is anything in those changes to the DB class that really NEEDS to be in the class. Those functions would work just as well in the usersc/custom_functions file and then you would be able to receive updates without breaking things. I'll look at the rest of the code.
12-28-2016, 03:07 PM
OHHHHH, like my migrateCat and migrateTemplate functions? Move those to custom_functions? Do I have to do any additional loading?
12-28-2016, 03:08 PM
Do you know which queries are triggering your errors? My guess is that it's somewhere in the
Code: $status='1'; Code: $db->approveRequest('templatesrequest',$id,$status); Code: $modifieduid = $uid; Code: $db->approveRequest2('templatesrequest',$id,$modifieduid);
12-28-2016, 03:09 PM
mudmin, I'm really not sure. If I remove any of those queries I will never know what caused it, and if I 'die()' the page doesn't load so I can't tell what is doing it.
12-28-2016, 03:34 PM
Ahh. Ok. Well, if you could help me figure out which query is the problem, I can help.
If you move those functions to custom functions you will have to make a few little changes like put the DB:Get instance thing at the top of the function (you can look in us_helpers for an example) and then get rid of the $this and change it to $db. Again, looking in us_helpers will show you a difference between writing it as a method (in a class) and function (not in a class). But even before that, let's figure out where the problem is... You don't just have to put die. You can give a description, so I would start at the top and change Code: if($validation->passed()){ Code: $db->update('templates',$requestid,$fields); Code: $successes[] = "Long Name Updated"; Code: if($validation->passed()){ Code: $db->update('templates',$requestid,$fields); Code: die('made it to the long name update'); Code: $successes[] = "Long Name Updated"; If you make it that far and you see the die message but no error on line 50 error then you know there is no problem with that query so go to the next one... Code: if($validation->passed()){ Code: $db->update('templates',$requestid,$fields); Code: die('made it to the text update'); Code: $successes[] = "Text Updated"; Do that for each query (one at a time) and once you see the error pop up, you will know which one is causing you the problem and we can fix it.
12-30-2016, 03:07 PM
mudmin,
You're a genius man! It looks like my problem lies with these lines on my Code: templatesreqedit.php Lines 112-115 on my original haste. Any thoughts on why? Could it have something to do with the fact I am posting numerical values instead of text values? Or what? Hmmm... Thanks!
12-30-2016, 05:09 PM
I would get those two functions out of the db class and put them in usersc/includes/custom_functions.php. I redid them for you...
https://hastebin.com/wokaqataji.xml
12-30-2016, 06:00 PM
Okay, so I moved them, as well as the migrateTemplate and migrateCat stuff I added, but now it is producing this error:
Code: Fatal error: Call to undefined method DB::approveRequest() in /home/aircentralized/public_html/boss/usersc/includes/external/templatesreqedit.php on line 113 Seems like it can't find the function. Thoughts? Am I doing something wrong? My custom_functions.php: https://hastebin.com/ujehokuqad.xml
12-31-2016, 02:30 PM
You need to put the functions in users/includes/custom_functions.php or it could be in some kind of script folder but there is already a file called custom functions it is automatically included in every single page.
Then you need to remove the $db-> from in front of approved equestrian when you call your functions on your pages |