Zen Cart Logo
Forums / Choosing Designers, Hosts, and Programmers / recommendations for developers please :(

recommendations for developers please :(

Views: 507

Results 21 to 40 of 55
20 Dec 2021, 2:25 PM
#21
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

recommendations for developers please :(

Hi Paul

I relayed our conversation to our Developers, which they have come back to advise that there is a MySQL Database query issue in the file:
”public_html/includes/classes/db/mysql/query_factory.php”

This file is part of the ZEN Cart core files which is outside of our control as it isn’t part of our payment module.
Please can you confirm the version of ZEN Cart installation you have installed, so we can confirm the latest version is in place?

Also, our Developers advise to raise this with ZEN Cart support developers referring to the error logs, as the issue is caused when the ZEN Cart core file "public_html/includes/classes/db/mysql/query_factory.php" creates the MySQL Database request related to the payment request.

Please ask them if they notice anything wrong in the part of the error log message I've marked in yellow:

"--> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 :: select [email protected] total FROM orders o, orders_total ot, orders_status s WHERE o.customers_id = 288 AND o.orders_id = ot.orders_id AND ot.class = 'ot_total' AND s.orders_status_id = (SELECT orders_status_id FROM orders_status_history osh WHERE osh.orders_id = o.orders_id AND osh.customer_notified >= 0 ==> (as called by) /home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/split_page_results.php on line 78 <== in /home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php on line 170."

> In this part "01D7F351.CE9FF910as total" There is no space between the id "01D7F351.CE9FF910" and the request word "as" which causes the MySQL command to fail. They could just make sure that this space in the request is being created by the MySQL command constructor, however, if the ZEN Cart development team is not being informed about this issue the next ZEN Cart system update will overwrite the correction again and the whole issue starts over. This means your Developers would need to address this with the ZEN Cart development team to make sure this is being fixed in the ZEN Cart system to prevent future occurrences.
> 
> In regards to the delay of 40 minutes showing the payment in MMS, due to it being the pre-Christmas time during covid-19 pandemic restrictions, the payment gateway is most likely extremely busy with a massive database processing queue so there may be a delay in the payment showing on the MMS Portal but it won’t have an impact to it being processed.
> 
> Please let me know what your Developers find and advise so we can assist further where possible.
> 
> Kind Regards
> 
> rt, takepayments

So can anyone actually tell me what this means and how id go about finding/fixing this issue please? i follow about 40% of it myself, ie where the location of the issue is, thats about it lol :(

edited to re add the code snippet

"--> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 :: select [email protected] total FROM orders o, orders_total ot, orders_status s WHERE o.customers_id = 288 AND o.orders_id = ot.orders_id AND ot.class = 'ot_total' AND s.orders_status_id = (SELECT orders_status_id FROM orders_status_history osh WHERE osh.orders_id = o.orders_id AND osh.customer_notified >= 0 ==> (as called by) /home/u554521074/domains/crazygamer.uk/public_html/includes/classes/split_page_results.php on line 78 <== in /home/u554521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php on line 170."


at line 1 :: select [email protected] total FROM orders between the @ and total they highlighted
20 Dec 2021, 2:50 PM
#22
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: recommendations for developers please :(

It's some code that's been inserted into your /includes/classes/split_page_results.php. Compare that module to its as-shipped Zen Cart version to see what's changed.

20 Dec 2021, 2:56 PM
#23
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: recommendations for developers please :(

Good and bad news about that file and error message...
First of all, that file: includes/classes/split_page_results.php had a query request to use similar mysql at that particular line (78) back in Zen Cart 1.5.6... at that time, the query though was expected to have parentheses around the central text and a space after the word total as shown in the following lines:

    $count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from));
    if ($debug) {
      echo 'count_query=' . $count_query . '<br /><br />';
    }
    $count = $db->Execute($count_query);

With that first line beginning at line 74 of the 1.5.6 version of the file. For Zen Cart 1.5.7, all of those are one line "higher" in the file (meaning would error at line 77 instead of 78.

So, as I thought this had been an upgrade to ZC 1.5.7 which means that something has been inserted before that line of execution, it could be a comment that the file was updated by this group or person, but it leads to identifying that the file may also not have been updated "fully" to the ZC 1.5.7 version.

What they are saying otherwise is that because the query itself is processed in the includes/classes/db/mysql/query_factory.php file (as are all queries in Zen Cart code) that somehow it is to blame for receiving a query from somewhere in the software that is incorrectly formed.

The query is malformed in the above file by either the first line in the above code missing a space and the appropriate parentheses or the data being processed is/was very very tricky and somehow deleted the information that is identified as missing...

Otherwise they are saying, thanks for the payment, guess its in the mail, don't worry we will deduct the amounts from it that we use...

Oh, btw, based on the above "its query_factory.php's fault" statement, something I probably said in the first 6-9 months of using Zen Cart well before additional troubleshooting tools were built into Zen Cart, get what corrections you can from them because to me that sort of claim about it being that file's fault shows little understanding about ZC other than changes to core code files must be duplicated to remain present during upgrades.

20 Dec 2021, 2:56 PM
#24
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

thanks bud will check that now thankyou :) does that by any chance relate to the search bars engine on my site also? thats so messed up, its either the last item, the first or the middle one you was looking for from a search term lol

20 Dec 2021, 2:59 PM
#25
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

mc12345678:

Good and bad news about that file and error message...
First of all, that file: includes/classes/split_page_results.php had a query request to use similar mysql at that particular line (78) back in Zen Cart 1.5.6... at that time, the query though was expected to have parentheses around the central text and a space after the word total as shown in the following lines:

$count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from));
if ($debug) {
  echo 'count_query=' . $count_query . '<br /><br />';
}
$count = $db->Execute($count_query);
> With that first line beginning at line 74 of the 1.5.6 version of the file. For Zen Cart 1.5.7, all of those are one line "higher" in the file (meaning would error at line 77 instead of 78. 
> 
> So, as I thought this had been an upgrade to ZC 1.5.7 which means that *something* has been inserted before that line of execution, it could be a comment that the file was updated by this group or person, but it leads to identifying that the file may also not have been updated "fully" to the ZC 1.5.7 version.
> 
> What they are saying otherwise is that because the query itself is processed in the includes/classes/db/mysql/query_factory.php file (as are all queries in Zen Cart code) that somehow it is to blame for receiving a query from somewhere in the software that is incorrectly formed.
> 
> The query is malformed in the above file by either the first line in the above code missing a space and the appropriate parentheses or the data being processed is/was very very tricky and somehow deleted the information that is identified as missing...
> 
> Otherwise they are saying, thanks for the payment, guess its in the mail, don't worry we will deduct the amounts from it that we use...
> 
> Oh, btw, based on the above "its query_factory.php's fault"   statement, something I probably said in the first 6-9 months of using Zen Cart well before additional troubleshooting tools were built into Zen Cart, get what corrections you can from them because to me that sort of claim about it being that file's fault shows little understanding about ZC other than changes to core code files must be duplicated to remain present during upgrades.

i replied as you did i believe, so my upgrade, well everything has been botched from the gecko? or a simple mistake? :(
20 Dec 2021, 3:19 PM
#26
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

<?php
/**
 * split_page_results Class.
 *
 * @package classes
 * @copyright Copyright 2003-2012 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: Ian Wilson  Fri Aug 17 17:54:58 2012 +0100 Modified in v1.5.1 $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
/**
 * Split Page Result Class
 *
 * An sql paging class, that allows for sql reslt to be shown over a number of pages using  simple navigation system
 * Overhaul scheduled for subsequent release
 *
 * @package classes
 */
class splitPageResults extends base {
  var $sql_query, $number_of_rows, $current_page_number, $number_of_pages, $number_of_rows_per_page, $page_name;

  /* class constructor */
  function __construct($query, $max_rows, $count_key = '*', $page_holder = 'page', $debug = false, $countQuery = "") {
    global $db;
    $max_rows = ($max_rows == '' || $max_rows == 0) ? 20 : $max_rows;

    $this->sql_query = preg_replace("/\n\r|\r\n|\n|\r/", " ", $query);
    if ($countQuery != "") $countQuery = preg_replace("/\n\r|\r\n|\n|\r/", " ", $countQuery);
    $this->countQuery = ($countQuery != "") ? $countQuery : $this->sql_query;
    $this->page_name = $page_holder;

    if ($debug) {
      echo '<br /><br />';
      echo 'original_query=' . $query . '<br /><br />';
      echo 'original_count_query=' . $countQuery . '<br /><br />';
      echo 'sql_query=' . $this->sql_query . '<br /><br />';
      echo 'count_query=' . $this->countQuery . '<br /><br />';
    }
    if (isset($_GET[$page_holder])) {
      $page = $_GET[$page_holder];
    } elseif (isset($_POST[$page_holder])) {
      $page = $_POST[$page_holder];
    } else {
      $page = '';
    }

    if (empty($page) || !is_numeric($page)) $page = 1;
    $this->current_page_number = $page;

    $this->number_of_rows_per_page = $max_rows;

    $pos_to = strlen($this->countQuery);

    $query_lower = strtolower($this->countQuery);
    $pos_from = strpos($query_lower, ' from', 0);

    $pos_group_by = strpos($query_lower, ' group by', $pos_from);
    if (($pos_group_by < $pos_to) && ($pos_group_by != false)) $pos_to = $pos_group_by;

    $pos_having = strpos($query_lower, ' having', $pos_from);
    if (($pos_having < $pos_to) && ($pos_having != false)) $pos_to = $pos_having;

    $pos_order_by = strpos($query_lower, ' order by', $pos_from);
    if (($pos_order_by < $pos_to) && ($pos_order_by != false)) $pos_to = $pos_order_by;

    if (strpos($query_lower, 'distinct') || strpos($query_lower, 'group by')) {
      $count_string = 'distinct ' . zen_db_input($count_key);
    } else {
      $count_string = zen_db_input($count_key);
    }
    $count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from));
    if ($debug) {
      echo 'count_query=' . $count_query . '<br /><br />';
    }
    $count = $db->Execute($count_query);

    $this->number_of_rows = $count->fields['total'];

    $this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);

    if ($this->current_page_number > $this->number_of_pages) {
      $this->current_page_number = $this->number_of_pages;
    }

    $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));

    // fix offset error on some versions
    if ($offset <= 0) { $offset = 0; }

    $this->sql_query .= " limit " . ($offset > 0 ? $offset . ", " : '') . $this->number_of_rows_per_page;
  }

  /* class functions */

  // display split-page-number-links
  function display_links($max_page_links, $parameters = '') {
    global $request_type;
    if ($max_page_links == '') $max_page_links = 1;

    $display_links_string = '';

    $class = '';

    if (zen_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&';

    // previous button - not displayed on first page
    if ($this->current_page_number > 1) $display_links_string .= '<a class="prev" href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' ">' . PREVNEXT_BUTTON_PREV . '</a>';

    // check if number_of_pages > $max_page_links
    $cur_window_num = intval($this->current_page_number / $max_page_links);
    if ($this->current_page_number % $max_page_links) $cur_window_num++;

    $max_window_num = intval($this->number_of_pages / $max_page_links);
    if ($this->number_of_pages % $max_page_links) $max_window_num++;

    // previous window of pages
    if ($cur_window_num > 1) $display_links_string .= '<a class="prev" href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num - 1) * $max_page_links), $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';

    // page nn button
    for ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) {
      if ($jump_to_page == $this->current_page_number) {
        $display_links_string .= '<strong class="current">' . $jump_to_page . '</strong>';
      } else {
        $display_links_string .= '<a href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' ">' . $jump_to_page . '</a>';
      }
    }

    // next window of pages
    if ($cur_window_num < $max_window_num) $display_links_string .= '<a class="next" href="' . zen_href_link($_GET['main_page'], $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type) . '" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';

    // next button
    if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) $display_links_string .= '<a class="next" href="' . zen_href_link($_GET['main_page'], $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' ">' . PREVNEXT_BUTTON_NEXT . '</a>';

    if ($display_links_string == '<strong class="current">1</strong>') {
      return '';
    } else {
      return $display_links_string;
    }
  }

  // display number of total products found
  function display_count($text_output) {
    $to_num = ($this->number_of_rows_per_page * $this->current_page_number);
    if ($to_num > $this->number_of_rows) $to_num = $this->number_of_rows;

    $from_num = ($this->number_of_rows_per_page * ($this->current_page_number - 1));

    if ($to_num == 0) {
      $from_num = 0;
    } else {
      $from_num++;
    }

    if ($to_num <= 1) {
      // don't show count when 1
      return '';
    } else {
      return sprintf($text_output, $from_num, $to_num, $this->number_of_rows);
    }
  }
}

just grabbed the whole .php from the server to share, makes more sense than my previous reply of desperation and woe lol.
No author change line ect to account for the line difference so this is the 1.56 version i'm guessing without having to download it and compare based on your analysis above?

20 Dec 2021, 3:29 PM
#27
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

https://1drv.ms/u/s!Aq-zsqgYfZQWhOcqmdWkAulJZ_g2Hg?e=YHGApz heres the results of the comparison between these two files the one from the latest download from zen is obviously different by miles, it has mc's name in it :) :(

20 Dec 2021, 7:37 PM
#28
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: recommendations for developers please :(

bud,
as previously stated (by mc), 'I thought this had been an upgrade to ZC 1.5.7...'

you yourself stated you are running 1.5.7b. the file you posted is from 1.5.1. whoever did your upgrade missing a few things.

copy the 157 version of this file to your site and wait for the next error logs to materialize.

looking at a diff is a waste of time as the odds someone changed that core file are small. and your error seems to indicate this outdated script is the culprit.

best.

20 Dec 2021, 7:42 PM
#29
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: recommendations for developers please :(

Long story short: your upgrade was a failure. I suspect you're going to have to get it done again.
I have seen this kind of thing happen a number of times over the years.

20 Dec 2021, 10:47 PM
#30
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

Add Sabatage to that checklist of wrong doings, checkout issue.... just resolved it myself from within the admin panel!!!!!!

USU settings last setting was set to false, i remember distinctly that was preset as true. moment i change auto redirects from false to true.... i can now make transactions on my own gateway with my card and see them in mms within about 2 mins ready to void off.

My sites template is made by them, its an old template that wasnt updated to latest zen, i liked it though and was struggling to find any compatible templates with latest zen at the time (1.57b or a) im sure it was b. seems they sent junior developers onto the job from what ive peaced together from that slight slip of details every now and then.

I need to check through my admin panel now. question though, i've restricted all access to hpanel and account sharing there so they can't manage ftp and deleted there ftp details and erased admin panel. can they use backups to trigger stuff from a test server ect? ie should i change database passwords ect?

20 Dec 2021, 11:29 PM
#31
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

carlwhat:

bud,
as previously stated (by mc), 'I thought this had been an upgrade to ZC 1.5.7...'

you yourself stated you are running 1.5.7b. the file you posted is from 1.5.1. whoever did your upgrade missing a few things.

copy the 157 version of this file to your site and wait for the next error logs to materialize.

looking at a diff is a waste of time as the odds someone changed that core file are small. and your error seems to indicate this outdated script is the culprit.

best.

no massive changes that would happen from doing that or should i keep a copy of the old one? and no my admin says im running 1.57c, thats part of what ive paid for in the long run with these guys, site setup added merchant feedeer then added easy populate and charged me for loads of faulty edits he had to remove later on to restore thing to functional ie easy populate itself.

if this isn't upgrade to 1.57c then the company in question should hang there heads in shame as they've patched it to appear they have upgraded it

20 Dec 2021, 11:38 PM
#32
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

Attachment 19861 just took this quickly just to show like it is definitely saying its updated

20 Dec 2021, 11:56 PM
#33
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

that updated file is in place all seems good, still have this issue with empty categories. had about 12 error logs today, last 2 one mentions google product feeder and something to do with the ftp upload, it works though. second one down the list i don't understand, can i ignore this guys or is this another place to check into?

[20-Dec-2021 22:28:18 UTC] Request URI: /!!!!!-admin/index.php?cmd=configuration_default&gID=46&cID=917&action=save, IP address: 8x.8.17x.11x
#1  zen_admin_demo() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/!!!!!-admin/configuration_default.php:19]
#2  require(/home/uxxx521074/domains/crazygamer.uk/public_html/!!!-admin/configuration_default.php) called at [/home/uxxx521074/domains/crazygamer.uk/public_html/!!!!-admin/index.php:11]
--> PHP Warning: Use of undefined constant ADMIN_DEMO - assumed 'ADMIN_DEMO' (this will throw an Error in a future version of PHP) in /home/uxxx521074/domains/crazygamer.uk/public_html/!!!!!!!!!!!-admin/includes/functions/general.php on line 3850.
21 Dec 2021, 12:37 AM
#34
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: recommendations for developers please :(

hey bud,
zen_admin_demo and ADMIN_DEMO and ERROR_ADMIN_DEMO were all pulled out in v157.

in addition, this file:

admin/configuration_default.php

(which you have) does not look to be part of any ZC version. so someone was doing some modifying on the admin side.

years of customizations can take a while to reconfigure to the latest version of ZC.

best.

21 Dec 2021, 12:54 AM
#35
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

carlwhat:

hey bud,
zen_admin_demo and ADMIN_DEMO and ERROR_ADMIN_DEMO were all pulled out in v157.

in addition, this file:

admin/configuration_default.php

(which you have) does not look to be part of any ZC version. so someone was doing some modifying on the admin side.

years of customizations can take a while to reconfigure to the latest version of ZC.

best.

it seems to be none existent in my admin folder that file? its not actually there to load if its looking for it, the plot thickens again lol, my head hurts

21 Dec 2021, 2:05 AM
#36
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: recommendations for developers please :(

that file is there. for sure. that's where the error is coming from....

21 Dec 2021, 2:11 AM
#37
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

carlwhat:

that file is there. for sure. that's where the error is coming from....

ive not slept for about 36-48 hours now, realised i was looking in the root not the admin folder :s lol

<?php
/**
 * @package admin
 * @copyright Copyright 2003-2014 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: DrByte  Jun 30 2014 Modified in v1.5.4 $
 */

  require_once('includes/application_top.php');

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'save':
        $cID = zen_db_prepare_input($_GET['cID']);
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . (int)$cID));
        }
        $configuration_value = zen_db_prepare_input($_POST['configuration_value']);

        $db->Execute("update " . TABLE_CONFIGURATION . "
                      set configuration_value = '" . zen_db_input($configuration_value) . "',
                          last_modified = now() where configuration_id = '" . (int)$cID . "'");

        $result = $db->Execute("select configuration_key from " . TABLE_CONFIGURATION . " where configuration_id=" . (int)$cID . " LIMIT 1");
        if (function_exists('zen_record_admin_activity')) zen_record_admin_activity('Configuration setting changed for ' . $result->fields['configuration_key'] . ': ' . $configuration_value, 'warning');

        // set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
        if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'true') ) {
        $db->Execute("update " . TABLE_CONFIGURATION . "
                      set configuration_value = 'false', last_modified = '" . NOW . "'
                      where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'"); }

        zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . (int)$cID));
        break;
    }
  }

  $gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1;
  $_GET['gID'] = $gID;
  $cfg_group = $db->Execute("select configuration_group_title
                             from " . TABLE_CONFIGURATION_GROUP . "
                             where configuration_group_id = '" . (int)$gID . "'");

if ($gID == 7) {
        $shipping_errors = '';
        if (zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == 'NONE' or zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == '') {
          $shipping_errors .= '<br />' . ERROR_SHIPPING_ORIGIN_ZIP;
        }
        if (zen_get_configuration_key_value('ORDER_WEIGHT_ZERO_STATUS') == '1' and !defined('MODULE_SHIPPING_FREESHIPPER_STATUS')) {
          $shipping_errors .= '<br />' . ERROR_ORDER_WEIGHT_ZERO_STATUS;
        }
        if (defined('MODULE_SHIPPING_USPS_STATUS') and (MODULE_SHIPPING_USPS_USERID=='NONE' or MODULE_SHIPPING_USPS_SERVER == 'test')) {
          $shipping_errors .= '<br />' . ERROR_USPS_STATUS;
        }
        if ($shipping_errors != '') {
          $messageStack->add(ERROR_SHIPPING_CONFIGURATION . $shipping_errors, 'caution');
        }
}

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo $cfg_group->fields['configuration_group_title']; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent" width="55%"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
              </tr>
<?php
  $configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
                                        use_function from " . TABLE_CONFIGURATION . "
                                        where configuration_group_id = '" . (int)$gID . "'
                                        order by sort_order");
  while (!$configuration->EOF) {
    if (zen_not_null($configuration->fields['use_function'])) {
      $use_function = $configuration->fields['use_function'];
      if (preg_match('/->/', $use_function)) {
        $class_method = explode('->', $use_function);
        if (!is_object(${$class_method[0]})) {
          include(DIR_WS_CLASSES . $class_method[0] . '.php');
          ${$class_method[0]} = new $class_method[0]();
        }
        $cfgValue = zen_call_function($class_method[1], $configuration->fields['configuration_value'], ${$class_method[0]});
      } else {
        $cfgValue = zen_call_function($use_function, $configuration->fields['configuration_value']);
      }
    } else {
      $cfgValue = $configuration->fields['configuration_value'];
    }

    if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $configuration->fields['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
      $cfg_extra = $db->Execute("select configuration_key, configuration_description, date_added,
                                        last_modified, use_function, set_function
                                 from " . TABLE_CONFIGURATION . "
                                 where configuration_id = '" . (int)$configuration->fields['configuration_id'] . "'");
      $cInfo_array = array_merge($configuration->fields, $cfg_extra->fields);
      $cInfo = new objectInfo($cInfo_array);
    }

    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) {
      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id'] . '&action=edit') . '\'">' . "\n";
    }
?>
                <td class="dataTableContent"><?php echo $configuration->fields['configuration_title']; ?></td>
                <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue, ENT_COMPAT, CHARSET, TRUE); ?></td>
                <td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id']) . '" name="link_' . $configuration->fields['configuration_key'] . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
              </tr>
<?php
    $configuration->MoveNext();
  }
?>
            </table></td>
<?php
  $heading = array();
  $contents = array();

  switch ($action) {
    case 'edit':
      $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');

      if ($cInfo->set_function) {
        eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE) . '");');
      } else {
        $value_field = zen_draw_input_field('configuration_value', htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE), 'size="60"');
      }

      $contents = array('form' => zen_draw_form('configuration', 'configuration_default.php', 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
      if (ADMIN_CONFIGURATION_KEY_ON == 1) {
        $contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
      }
      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
      $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE, 'name="submit' . $cInfo->configuration_key . '"') . ' <a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (isset($cInfo) && is_object($cInfo)) {
        $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
        if (ADMIN_CONFIGURATION_KEY_ON == 1) {
          $contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
        }

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
        $contents[] = array('text' => '<br>' . $cInfo->configuration_description);
        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($cInfo->date_added));
        if (zen_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($cInfo->last_modified));
      }
      break;
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
21 Dec 2021, 12:44 PM
#38
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

Ok so my checkout works for me when i tried with my visa card, however, this error popped up middle of the night, it seems to be this error thats responsible for the 3d secure box failing if i had to take a guess at where this error is happening. Can anyone suggest anything i can try to fix this myself?

[21-Dec-2021 01:04:32 UTC] Request URI: /index.php?main_page=product_info&products_id=1691, IP address: 82.xx.34.199
#1  trigger_error() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php:170]
#2  queryFactory->show_error() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php:142]
#3  queryFactory->set_error() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php:226]
#4  queryFactory->Execute() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/usu.php:761]
#5  usu->get_category_name() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/usu.php:678]
#6  usu->get_product_canonical() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/usu.php:1456]
#7  usu->canonical() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/observers/UsuObserver.php:64]
#8  UsuObserver->update() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/class.base.php:118]
#9  base->notify() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/init_includes/init_canonical.php:42]
#10 require_once(/home/uxxx521074/domains/crazygamer.uk/public_html/includes/init_includes/init_canonical.php) called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/autoload_func.php:37]
#11 require(/home/uxxx521074/domains/crazygamer.uk/public_html/includes/autoload_func.php) called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/application_top.php:222]
#12 require(/home/uxxx521074/domains/crazygamer.uk/public_html/includes/application_top.php) called at [/home/uxxx521074/domains/crazygamer.uk/public_html/index.php:25]
--> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND language_id = 1
                          LIMIT 1' at line 4 :: SELECT categories_name AS cName
                           FROM categories_description
                          WHERE categories_id = 
                            AND language_id = 1
                          LIMIT 1 ==> (as called by) /home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/usu.php on line 761 <== in /home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php on line 170.

woking on the assumption my site is actually 1.56 thats been patched just enough for the system to say its 1.57c, this error is being caused by latest usu being coded for latest zen so what file is it looking for here and either isn't there or is an old version?

edited to add..

please say one file swap is all i need, i know im being hopeful lol

21 Dec 2021, 1:01 PM
#39
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: recommendations for developers please :(

flappingfish:

Ok so my checkout works for me when i tried with my visa card, however, this error popped up middle of the night, it seems to be this error thats responsible for the 3d secure box failing if i had to take a guess at where this error is happening. Can anyone suggest anything i can try to fix this myself?

[21-Dec-2021 01:04:32 UTC] Request URI: /index.php?main_page=product_info&products_id=1691, IP address: 82.xx.34.199
#1 trigger_error() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php:170]
#2 queryFactory->show_error() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php:142]
#3 queryFactory->set_error() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php:226]
#4 queryFactory->Execute() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/usu.php:761]
#5 usu->get_category_name() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/usu.php:678]
#6 usu->get_product_canonical() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/usu.php:1456]
#7 usu->canonical() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/observers/UsuObserver.php:64]
#8 UsuObserver->update() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/class.base.php:118]
#9 base->notify() called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/init_includes/init_canonical.php:42]
#10 require_once(/home/uxxx521074/domains/crazygamer.uk/public_html/includes/init_includes/init_canonical.php) called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/autoload_func.php:37]
#11 require(/home/uxxx521074/domains/crazygamer.uk/public_html/includes/autoload_func.php) called at [/home/uxxx521074/domains/crazygamer.uk/public_html/includes/application_top.php:222]
#12 require(/home/uxxx521074/domains/crazygamer.uk/public_html/includes/application_top.php) called at [/home/uxxx521074/domains/crazygamer.uk/public_html/index.php:25]
--> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND language_id = 1
LIMIT 1' at line 4 :: SELECT categories_name AS cName
FROM categories_description
WHERE categories_id =
AND language_id = 1
LIMIT 1 ==> (as called by) /home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/usu.php on line 761 <== in /home/uxxx521074/domains/crazygamer.uk/public_html/includes/classes/db/mysql/query_factory.php on line 170.

> 
> woking on the assumption my site is actually 1.56 thats been patched just enough for the system to say its 1.57c, this error is being caused by latest usu being coded for latest zen so what file is it looking for here and either isn't there or is an old version?
> 
> edited to add..
> 
> please say one file swap is all i need, i know im being hopeful lol
I still, like others, do not believe that it is truly USU that causes the problem, but instead reveals that a problem exists. From the looks of the path information that is being buiolt while looking at the product page for products_id=1691 this time, there is a product that is getting its category name retrieved. Because the error log history information, that particular product has a master_categories_id that is not a non-zerolike number. This is identified by the call to request the canonical link of the product in question. Now, this product might in fact be products_id 1691 but it may also be some other product that is being displayed about while one was looking at that page. However, looking further down in the history of the page request, issue #10 indicates that this line of issue is occurring as a part of the specific page load and not necessarily something else that is on the page. So I would look to see what the master category is for that product. If the product is not locatable while navigating the admin categories/products, then there is another issue to address with the database of this store...
21 Dec 2021, 1:23 PM
#40
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: recommendations for developers please :(

that was what i was trying to say, my habit of over wording stuff until it contradicts itself lol

so i searched the catalogue for item id 1691 a few ways without success. first i searched for it in the products page search bar in admin, then with the sites searchbar and then checked within the mysql php admin used a search for the product id in the products table and that item id doesn't exist.

Items did have to be mass deleted from the database after an "incident" where the first run of the feed i did after being told all was good after making the code add the appendage of "computing^" to the categories and not setting up or telling me i had to set up the "computing" category before running the .csv from the suppliers.

I then added the folder and reran the feed and it worked, all my items where indeed in subcategories within the computing section like i wanted. Sadly I had messed up on the feed and used cost rather than price so it was basically showing the wrong prices, i had one order and realised and amended it quickly.

Here's the funny part of the story, the first feed had populated these items but they was in a master category id of 0! these items didn't get there prices updated and where all over free google listings thanks to the google feeder module. I had to pick between annoying customers or making a small loss in the hope of feedback in return somewhere along the way, out of about 8 orders whilst i resolved this there was only one i chose to cancel, my supplier gave me a bit of a discount on some of the orders once we realised what was going on so i was breaking even from order 2 or 3 thanks to the kindness of my account handler there.

I ran a query for products with master category of id 0 or less and deleted some 1600 items that got returned from that query, ive double checked with that query again several times over the last few days but im finding no "ghost items" as i liked to call them