I did a careful removal - checking after each set of files and it looks like the culprit is autoloader/config.products_with_attributes_stock.php
Printable View
I did a careful removal - checking after each set of files and it looks like the culprit is autoloader/config.products_with_attributes_stock.php
In another thread you discussed the issue about this server responding with a 500 error when just loading the Zen Cart 1.5.8 files from a zip file. At the moment I don't recall whether that zip file was of your own making/revision or straight from the Zen Cart source. Then from what had been posted about this issue, I can't tell if changes made to support Zen Cart 1.5.8 class member inheritance have been incorporated or how against which github commit the fileset was obtained.
Basically, at the moment, unable to reproduce the issue. If server logs are not generated for you to see, would suggest contacting the host to gain more information. Removal of the autoloader file will prevent various operations, if all other files are present other than that one, I would suggest working within the file to remove actions starting at the back of the file.
The problem appeared to be the zip files before - the server is screwing up the extraction of them, leading to the initial problems. I simply uploaded the files for this. There is no "hosting" as it's an owner managed server. And everything else is working fine (a few mods installed). I did remove all other files before the autoloader - it was the last one and why I mentioned it.
Well, if the autoloader file truly was the last of the plugin to be removed, I am not surprised by site start issues. The autoloader really doesn't do anything other than identify what file(s) to load and in what order. Because most files in an autoloader are before error handling is fully in place, loading may stop with an onscreen message, but little else. Would have to enable debugging to see at what autoloader condition was last met.
So I installed it on a php 8.1 default site on my hosting. First was a mangled IS_ADMIN_FLAG statement in the admin lang.reg_ddsba.php. My fix was just to remove the whole statement. No other problems detected so far.
Assuming that the "older" language files weren't also on the server? I've applied a commit to correct the error generated in converting the files. That patch can be found at: https://github.com/mc12345678/Stock_...pull/107/files
The only change applicable to this issue is in the first few lines of each language file.
While that code section isn't "necessary" for operation, it is included to try not to cause issues if the software is loaded to a different system or if attempted to be executed without having stated Zen Cart for further processing.
Thank you for reporting this issue!
The specific commit that added back functionality is: Restore ZC1.5.8 functionality accessing protected members · mc12345678/Stock_By_Attributes_Combined@083359b (github.com)
However, there have been other improvements along the Zen Cart 1.5.8 consideration with commits made along the master path and the intention of not purposefully disabling older systems.
Trying to run SBA 1.5.4 for [ZC 1.5.8][PHP 8.0]
Few remarks for some errors in admin/products_with_attributes_stock page.
First it gives the following error
--> 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 'LIMIT 0, 1' at line 1
In admin/includes/classes/products_with_attributes_stock.php
on around line 376:
$SearchRange already carries a MySql LIMIT statement, however a consequtively coming call to splitPageResults adds another LIMIT statement so this triggers an error. I think the first $SearchRange can be ommited?PHP Code:
$query_products = "SELECT DISTINCT " . $retFieldsTxt . ((empty($search_order_by_fields) || empty($retFieldsTxt)) ? '' : ', ') . $search_order_by_fields . "
FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa
INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pa.products_id = pd.products_id)
INNER JOIN " . TABLE_PRODUCTS . " p ON (pa.products_id = p.products_id)
WHERE
pd.language_id=" . (int)$language_id . "
" . $w . "
ORDER BY " . $search_order_by;
// . $SearchRange; // zamzom: Took it out, because splitPageResults adds another LIMIT which triggers MySql error
if (!isset($_GET['seachPID']) && !isset($_GET['pwas-search-button']) && !isset($_GET['updateReturnedPID'])) {
$products_split = new splitPageResults($_GET['page'], STOCK_SET_SBA_NUMRECORDS, $query_products, $products_query_numrows);
}
Secondly, search does not function. It seems earlier search parameter was input through a Get statement (in admin/products_with_attributes_stock.php) however in the latest it was converted to a Post method. Nevertheless again in admin/includes/classes/products_with_attributes_stock.php around line 277
Get statements are used and these don't get anything :no: I think all of the $_GET['search'] should be replaced by $_POST['search']PHP Code:
if (isset($_GET['search']) && $_GET['search']) { // mc12345678 Why was $_GET['search'] omitted?
$s = zen_db_input($_GET['search']);
//$w = "(p.products_id = '$s' OR d.products_name LIKE '%$s%' OR p.products_model LIKE '%$s%') AND " ;//original version of search
//$w = "( p.products_id = '$s' OR d.products_name LIKE '%$s%' OR p.products_model LIKE '$s%' ) AND " ;//changed search to products_model 'startes with'.
//$w = "( p.products_id = '$s' OR d.products_name LIKE '%$s%' ) AND " ;//removed products_model from search
$w = " AND ( p.products_id = '$s'
OR d.products_name LIKE '%$s%'
OR p.products_model LIKE '%$s%'
OR p.products_id
IN (SELECT products_id
FROM " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " pwas
WHERE pwas.customid
LIKE '%$s%')
) "; //changed search to products_model 'starts with'.
}
//Show last edited record or Limit number of records displayed on page
$SearchRange = null;
if (isset($ReturnedProductID) && !isset($_GET['search'])) {
$ReturnedProductID = zen_db_input($ReturnedProductID);
//$w = "( p.products_id = '$ReturnedProductID' ) AND " ;//sets returned record to display
$w = " AND ( p.products_id = '$ReturnedProductID' ) " ;//sets returned record to display
if (empty($_GET['products_filter']) || $_GET['products_filter'] < 0) {
$SearchRange = "LIMIT 1";//show only selected record
}
also there is an error with the $w assignment, the tag for product description table should be pd instead of d, again around line 282:
PHP Code:
$w = " AND ( p.products_id = '$s'
OR pd.products_name LIKE '%$s%'
OR p.products_model LIKE '%$s%'
OR p.products_id
IN (SELECT products_id
FROM " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " pwas
WHERE pwas.customid
LIKE '%$s%')
) "; //changed search to products_model 'starts with'.
Trying to run SBA 1.5.4 for [ZC 1.5.8][PHP 8.0]
Few remarks for some errors in admin/products_with_attributes_stock page.
First it gives the following error
--> 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 'LIMIT 0, 1' at line 1
In admin/includes/classes/products_with_attributes_stock.php
on around line 376:
$SearchRange already carries a MySql LIMIT statement, however a consequtively coming call to splitPageResults adds another LIMIT statement so this triggers an error. I think the first $SearchRange can be ommited?PHP Code:
$query_products = "SELECT DISTINCT " . $retFieldsTxt . ((empty($search_order_by_fields) || empty($retFieldsTxt)) ? '' : ', ') . $search_order_by_fields . "
FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa
INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pa.products_id = pd.products_id)
INNER JOIN " . TABLE_PRODUCTS . " p ON (pa.products_id = p.products_id)
WHERE
pd.language_id=" . (int)$language_id . "
" . $w . "
ORDER BY " . $search_order_by;
// . $SearchRange; // zamzom: Took it out, because splitPageResults adds another LIMIT which triggers MySql error
if (!isset($_GET['seachPID']) && !isset($_GET['pwas-search-button']) && !isset($_GET['updateReturnedPID'])) {
$products_split = new splitPageResults($_GET['page'], STOCK_SET_SBA_NUMRECORDS, $query_products, $products_query_numrows);
}