X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   News and Announcements (https://forum.x-cart.com/forumdisplay.php?f=28)
-   -   X-Cart 4.6.1 released (https://forum.x-cart.com/showthread.php?t=67738)

cflsystems 10-27-2013 12:06 PM

Re: X-Cart 4.6.1 released
 
Now this has been reported before. It has been logged in the bugtracker. Long time ago. And it still exists which means it was never ever considered by QT for a fix

When security settings in admin are set to require password change every so many days this is what happens when the day comes.
1. Try to login to admin as normal - we don't know yet that password change is required.
2. Page is reloaded showing the exact same page as normal login and this message displays - "You should login before using "Change password" facility". (So what did I just do - I logged in right....)
3. So you enter the same login again, no other way around, and next screen is "change password" in admin with an error message "Error: You must change the password before you proceed."
4. After password is changed I am logged in automatically

QT does this sounds correct to you? If this is a feature (coded that way) please - take out that feature
After I "login" - I provide my username/password why am I told I should login before I can change password? I was not trying to change password but to login.

How this should work
1. Normal login
2. Try to login and change password screen should show with a message "You must change password first"
3. Change password
4. Here you can debate on this - either a message "password successfully changed" with login screen (preferable) OR same message with auto login

And when/if changing this to make it work correct please consider that admin and customer sides use the same code and files so if you fix the admin don't break the customer side

aim 10-28-2013 04:11 AM

Re: X-Cart 4.6.1 released
 
Quote:

Originally Posted by cflsystems
Now this has been reported before. It has been logged in the bugtracker. Long time ago. And it still exists which means it was never ever considered by QT for a fix

When security settings in admin are set to require password change every so many days this is what happens when the day comes.
1. Try to login to admin as normal - we don't know yet that password change is required.
2. Page is reloaded showing the exact same page as normal login and this message displays - "You should login before using "Change password" facility". (So what did I just do - I logged in right....)
3. So you enter the same login again, no other way around, and next screen is "change password" in admin with an error message "Error: You must change the password before you proceed."
4. After password is changed I am logged in automatically

QT does this sounds correct to you? If this is a feature (coded that way) please - take out that feature
After I "login" - I provide my username/password why am I told I should login before I can change password? I was not trying to change password but to login.

How this should work
1. Normal login
2. Try to login and change password screen should show with a message "You must change password first"
3. Change password
4. Here you can debate on this - either a message "password successfully changed" with login screen (preferable) OR same message with auto login

And when/if changing this to make it work correct please consider that admin and customer sides use the same code and files so if you fix the admin don't break the customer side


http://bt.x-cart.com/view.php?id=43007

cflsystems 10-28-2013 08:21 AM

Re: X-Cart 4.6.1 released
 
Thanks for adding this to the bugtracker.

This just happened to me on 2 different sites within a week - one 4.5.2 and the other 4.6.1 - so yes it is present in 4.6.1. But I have seen it on 4.4.x as well

I have just tested this on stock 4.6.1 and it works exactly as I described it so it does exist and is wrong

aim 10-29-2013 04:29 AM

Re: X-Cart 4.6.1 released
 
Quote:

Originally Posted by cflsystems
Thanks for adding this to the bugtracker.

This just happened to me on 2 different sites within a week - one 4.5.2 and the other 4.6.1 - so yes it is present in 4.6.1. But I have seen it on 4.4.x as well

I have just tested this on stock 4.6.1 and it works exactly as I described it so it does exist and is wrong


Thank you for the report.
It has been fixed in X-Cart 4.6.2

cflsystems 10-29-2013 08:36 AM

Re: X-Cart 4.6.1 released
 
Anyone interested this is the bug report - http://bt.x-cart.com/view.php?id=43007. Tested the fix on 4.6.1 and it works beautifully. The patch works on 4.5.x as well

cflsystems 11-17-2013 08:26 PM

Re: X-Cart 4.6.1 released
 
I am not sure if this has changed with 4.6.0 or 4.6.1 or even sometime with 4.5.x but did not change as expected. Some time ago I opened this bug report - https://bugtracker.qtmsoft.com/view.php?id=41595 - which was considered improvement not a bug...

So what the XC engineers have done now is to go around this bug report and take out all letters for which there are no products. You can see it on the demo site as well - http://demo.x-cart.com/demo/products_map.php - basically a broken alphabet

From the bug report - "WHAT IS THE EXPECTED RESULT? When there are no products to start with certain letter that letter should not be a link"

Keep the letter but don't make it a link, why would you take it out instead?

How this caught my attention - I just saw a site with ABCDEGHLPWX only.... Are you kidding me....

Either show all properly or don't show any at all

cflsystems 11-17-2013 09:06 PM

Re: X-Cart 4.6.1 released
 
OK let's fix this once and for all.
XC 4.6.1. File - /modules/Products_Map/func.php

This is the whole function marked and properly working

PHP Code:

/**
 * Return all avalable symbols
 * Return all letters + numeric properly marked to be a link or not based on products availability :: CFL Systems
 *
 * @return array
 */
function pmap_get_symbols()
{
    global 
$sql_tbl$default_charset;
    
// create array of all available symbols from products
    // $all_symbols = func_query_column("SELECT DISTINCT LEFT(product,1) AS letter FROM $sql_tbl[products_lng_current]");
 
    /* exclude disabled products - customers cannot access them anyway :: CFL Systems */
    
$all_symbols func_query_column("SELECT DISTINCT LEFT(product,1) AS letter FROM $sql_tbl[products_lng_current] LEFT JOIN $sql_tbl[products] ON $sql_tbl[products_lng_current].productid = $sql_tbl[products].productid WHERE $sql_tbl[products].forsale != 'N'");
    
// uppercase
    
if (function_exists('mb_strtoupper')) {
        
mb_internal_encoding($default_charset);
        
$all_symbols array_map('mb_strtoupper'$all_symbols);
    } else {
        
$all_symbols array_map('strtoupper'$all_symbols);
    }
    
$all = array();
    foreach(
$all_symbols as $key => $symb) {
        if (
is_numeric($symb)) {
            
$has_numeric true;
            break; 
/* stop foreach when number is found :: CFL Systems */
        
} else {
        
//    $all[$symb] = true;
        
}
    }
    if (!empty(
$has_numeric))
        
$all['0-9'] = true;
    else 
/* add numeric either way :: CFL Systems */
        
$all['0-9'] = false;
    
/* START - properly populate alphabet :: CFL Systems */
    
$letters range('A''Z');
 
    foreach (
$letters as $letter) {
 
      if (
in_array($letter$all_symbols))
          
$all[$letter] = true;
      else
          
$all[$letter] = false;
 
    }
    
/* END - properly populate alphabet :: CFL Systems */
 
    
return $all;



* Small addition to keep page from loading without products
in the same function file right after

PHP Code:

/**
 * Get current symbol
 *
 * @param  array $avail_symbols
 * @return string
 */
function pamp_get_current_symbol($avail_symbols)



add

PHP Code:

/* unset symbols without products :: CFL Systems */
    
foreach ($avail_symbols as $k => $v) {
        if (empty(
$v)) {
            unset(
$avail_symbols[$k]);
        }
    } 


kustomrides 01-03-2014 01:41 PM

Re: X-Cart 4.6.1 released
 
I decided to do a clean install on this on a subdirectory (/xcart) and am surprised to receive this error in working with adding/modifying products:

"Access denied!
A product missing from the database was requested.
Error ID: 33"

The config file is fine ($single_mode = true)

Figuring that I may have made an error while importing from the database, I reinstalled fresh and populated with xcart's example categories & products. Then I went to modify one of the products and still got the error code.

Then I checked database integrity and see this:

"Error: The table xcart_products_lng_en contains some records for which related data in the table xcart_quick_flags has not been found:
productid: 17671"

So yes I can fix this in the database ... but I would have to do this for every product I add or modify.

Any ideas on what's going wrong?

EDIT: Figured out that my playing with the blowfish key was the cause.

cflsystems 01-08-2014 10:49 AM

Re: X-Cart 4.6.1 released
 
Socialize module bug

home.tpl has this code
Code:

        {if $config.Socialize.soc_fb_like_enabled eq "Y" or $config.Socialize.soc_fb_send_enabled eq "Y"}
          <div id="fb-root"></div>
        {/if}


even if you have the Socialize module OFF this still runs and places code on every page - the settings for the module are set to ON by default. It should be

Code:

{if $active_modules.Socialize and ($config.Socialize.soc_fb_like_enabled eq "Y" or $config.Socialize.soc_fb_send_enabled eq "Y")}
  <div id="fb-root"></div>
{/if}


elmirage001 02-17-2014 08:53 PM

Re: X-Cart 4.6.1 released
 
When module "Product Options" is turned off and I try to delete a product the product deletes and then I go to a blank screen and the following error
Quote:

PHP Fatal error: Class 'XCVariantsSQL' not found in /home/xxxxxxxx/public_html/include/func/func.product.php on line 869
Line 869 in Red
Code:

// Product options module
    if (func_is_defined_module_sql_tbl('Product_Options', 'class_options')) {

        $classes = func_query_column("SELECT classid FROM $sql_tbl[classes] WHERE productid='$productid'");
        db_query("DELETE FROM $sql_tbl[classes] WHERE productid='$productid'");
        if (!empty($classes)) {
            $options = func_query_column("SELECT optionid FROM $sql_tbl[class_options] WHERE classid IN ('".implode("','", $classes)."')");
            db_query("DELETE FROM $sql_tbl[class_lng] WHERE classid IN ('".implode("','", $classes)."')");
            if (!empty($options)) {
                db_query("DELETE FROM $sql_tbl[class_options] WHERE classid IN ('".implode("','", $classes)."')");
                db_query("DELETE FROM $sql_tbl[product_options_lng] WHERE optionid IN ('".implode("','", $options)."')");
                db_query("DELETE FROM $sql_tbl[product_options_ex] WHERE optionid IN ('".implode("','", $options)."')");
                db_query("DELETE FROM $sql_tbl[variant_items] WHERE optionid IN ('".implode("','", $options)."')");
                db_query("DELETE FROM $sql_tbl[variant_backups] WHERE optionid IN ('".implode("','", $options)."')");
            }
        }

        db_query("DELETE FROM $sql_tbl[product_options_js] WHERE productid='$productid'");
        $vids = db_query("SELECT variantid FROM $sql_tbl[variants] WHERE productid='$productid' AND " . XCVariantsSQL::isVariantRow($productid));
        if ($vids) {
            while ($row = db_fetch_array($vids)) {
                func_delete_image($row['variantid'], "W");
            }
            db_free_result($vids);
        }
        db_query("DELETE FROM $sql_tbl[variants] WHERE productid='$productid'");
    }

If I turn "Product Options" back on and I delete a product everything works fine.

I don't know if this happens on a stock 4.6.1 or not as I upgraded my database from 4.4.5 to 4.6.1

I reported on bug tracker but maybe someone else would like to test also. Thanks!

Paul

aim 02-17-2014 09:18 PM

Re: X-Cart 4.6.1 released
 
1 Attachment(s)
Quote:

Originally Posted by elmirage001
When module "Product Options" is turned off and I try to delete a product the product deletes and then I go to a blank screen and the following error
Line 869 in Red
Code:

// Product options module
    if (func_is_defined_module_sql_tbl('Product_Options', 'class_options')) {

        $classes = func_query_column("SELECT classid FROM $sql_tbl[classes] WHERE productid='$productid'");
        db_query("DELETE FROM $sql_tbl[classes] WHERE productid='$productid'");
        if (!empty($classes)) {
            $options = func_query_column("SELECT optionid FROM $sql_tbl[class_options] WHERE classid IN ('".implode("','", $classes)."')");
            db_query("DELETE FROM $sql_tbl[class_lng] WHERE classid IN ('".implode("','", $classes)."')");
            if (!empty($options)) {
                db_query("DELETE FROM $sql_tbl[class_options] WHERE classid IN ('".implode("','", $classes)."')");
                db_query("DELETE FROM $sql_tbl[product_options_lng] WHERE optionid IN ('".implode("','", $options)."')");
                db_query("DELETE FROM $sql_tbl[product_options_ex] WHERE optionid IN ('".implode("','", $options)."')");
                db_query("DELETE FROM $sql_tbl[variant_items] WHERE optionid IN ('".implode("','", $options)."')");
                db_query("DELETE FROM $sql_tbl[variant_backups] WHERE optionid IN ('".implode("','", $options)."')");
            }
        }

        db_query("DELETE FROM $sql_tbl[product_options_js] WHERE productid='$productid'");
        $vids = db_query("SELECT variantid FROM $sql_tbl[variants] WHERE productid='$productid' AND " . XCVariantsSQL::isVariantRow($productid));
        if ($vids) {
            while ($row = db_fetch_array($vids)) {
                func_delete_image($row['variantid'], "W");
            }
            db_free_result($vids);
        }
        db_query("DELETE FROM $sql_tbl[variants] WHERE productid='$productid'");
    }

If I turn "Product Options" back on and I delete a product everything works fine.

I don't know if this happens on a stock 4.6.1 or not as I upgraded my database from 4.4.5 to 4.6.1

I reported on bug tracker but maybe someone else would like to test also. Thanks!

Paul


The fix_fatal_error_on_product_delete.diff patch has been attached

elmirage001 02-17-2014 09:44 PM

Re: X-Cart 4.6.1 released
 
Wow was that quick! I was just about to post your fix but you beat me to it Thank you so much! Paul

designguru 02-17-2014 11:59 PM

Re: X-Cart 4.6.1 released
 
If we setup a fresh install of 4.6.1. How can we bring all the mods and customization to this version?

Of course the mods can be re-installed and hopefully will use the data from the database but what happens to all the customizations?


All times are GMT -8. The time now is 06:40 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.