Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jun 2008
    Location
    Singapore, Australia, America
    Posts
    96
    Plugin Contributions
    0

    Default Admin blank page - CEON URL mapping

    I am experiencing admin black issues, when deleting a product.

    Add-on:
    CEON URL mapping
    Template:
    Westminster NEW

    At first, I had problem with copying and editing product:
    1. After copying, it returned with blank page, but product is copied after hitting ‘back’ button
    2. After editing a product, and hit ‘update’, it returned to blank page

    I managed to solve the problem, it’s a merge problem with these files:
    /admin/includes/modules/copy_to_confirm.php
    /admin/includes/modules/move_product_confirm.php
    /admin/includes/modules/update_product.php

    It appeared that CEON URL mapping code conflicts with the new 1.54 file.

    The current problem:
    1. Moving product and delete product, it returned with blank page.

    Please help me look at the merged file of ‘move_product_confirm.php’:
    PHP Code:
    <?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 $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die(
    'Illegal Access');
    }

            
    $products_id zen_db_prepare_input($_POST['products_id']);
            
    $new_parent_id zen_db_prepare_input($_POST['move_to_category_id']);

            
    $duplicate_check $db->Execute("select count(*) as total
                                            from " 
    TABLE_PRODUCTS_TO_CATEGORIES "
                                            where products_id = '" 
    . (int)$products_id "'
                                            and categories_id = '" 
    . (int)$new_parent_id "'");

            if (
    $duplicate_check->fields['total'] < 1) {
              
    $db->Execute("update " TABLE_PRODUCTS_TO_CATEGORIES "
                            set categories_id = '" 
    . (int)$new_parent_id "'
                            where products_id = '" 
    . (int)$products_id "'
                            and categories_id = '" 
    . (int)$current_category_id "'");

              
    // reset master_categories_id if moved from original master category
              
    $check_master $db->Execute("select products_id, master_categories_id from " TABLE_PRODUCTS " where products_id='" .  (int)$products_id "'");
              if (
    $check_master->fields['master_categories_id'] == (int)$current_category_id) {
                
    $db->Execute("update " TABLE_PRODUCTS "
                              set master_categories_id='" 
    . (int)$new_parent_id "'
                              where products_id = '" 
    . (int)$products_id "'");
              }

              
    // BEGIN CEON URI MAPPING 1 of 1
              
    require_once(DIR_WS_CLASSES 'class.CeonURIMappingAdminProductPages.php');
              
              
    $ceon_uri_mapping_admin = new CeonURIMappingAdminProductPages();
              
              
    $ceon_uri_mapping_admin->moveProductConfirmHandler($products_id$product_type,
                
    $zc_products->get_handler($product_type), $new_parent_id);
              
              
    // END CEON URI MAPPING 1 of 1
              // reset products_price_sorter for searches etc.
              
    zen_update_products_price_sorter((int)$products_id);
              
    zen_record_admin_activity('Moved product ' . (int)$products_id ' from category ' . (int)$current_category_id ' to category ' . (int)$new_parent_id'notice');

            } else {
              
    $messageStack->add_session(ERROR_CANNOT_MOVE_PRODUCT_TO_CATEGORY_SELF'error');
            }

            
    zen_redirect(zen_href_link(FILENAME_CATEGORIES'cPath=' $new_parent_id '&pID=' $products_id . (isset($_GET['page']) ? '&page=' $_GET['page'] : '')));

    3. I know delete_product_confirm file is not in the change log, but since the upgrade, the delete function also returns with blank page.

    My current update_product.php looks like this:
    PHP Code:
    <?php
    /**
     * @package admin
     * @copyright Copyright 2003-2013 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  Tue Feb 12 10:13:44 2013 -0500 Modified in v1.5.3 $
     */
      
    if (!defined('IS_ADMIN_FLAG')) {
        die(
    'Illegal Access');
      }
      if (isset(
    $_GET['pID'])) $products_id zen_db_prepare_input($_GET['pID']);
      if (isset(
    $_POST['edit_x']) || isset($_POST['edit_y'])) {
        
    $action 'new_product';
      } elseif (
    $_POST['products_model'] . $_POST['products_url'] . $_POST['products_name'] . $_POST['products_description'] != '') {
        
    $products_date_available zen_db_prepare_input($_POST['products_date_available']);

        
    $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available 'null';

        
    // Data-cleaning to prevent MySQL5 data-type mismatch errors:
        
    $tmp_value zen_db_prepare_input($_POST['products_quantity']);
        
    $products_quantity = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? $tmp_value;
        
    $tmp_value zen_db_prepare_input($_POST['products_price']);
        
    $products_price = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? $tmp_value;
        
    $tmp_value zen_db_prepare_input($_POST['products_weight']);
        
    $products_weight = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? $tmp_value;
        
    $tmp_value zen_db_prepare_input($_POST['manufacturers_id']);
        
    $manufacturers_id = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? $tmp_value;

        
    $sql_data_array = array('products_quantity' => $products_quantity,
                                
    'products_type' => zen_db_prepare_input($_GET['product_type']),
                                
    'products_model' => zen_db_prepare_input($_POST['products_model']),
                                
    'products_price' => $products_price,
                                
    'products_date_available' => $products_date_available,
                                
    'products_weight' => $products_weight,
                                
    'products_status' => zen_db_prepare_input((int)$_POST['products_status']),
                                
    'products_virtual' => zen_db_prepare_input((int)$_POST['products_virtual']),
                                
    'products_tax_class_id' => zen_db_prepare_input((int)$_POST['products_tax_class_id']),
                                
    'manufacturers_id' => $manufacturers_id,
                                
    'products_quantity_order_min' => zen_db_prepare_input($_POST['products_quantity_order_min']),
                                
    'products_quantity_order_units' => zen_db_prepare_input($_POST['products_quantity_order_units']),
                                
    'products_priced_by_attribute' => zen_db_prepare_input((int)$_POST['products_priced_by_attribute']),
                                
    'product_is_free' => zen_db_prepare_input((int)$_POST['product_is_free']),
                                
    'product_is_call' => zen_db_prepare_input((int)$_POST['product_is_call']),
                                
    'products_quantity_mixed' => zen_db_prepare_input($_POST['products_quantity_mixed']),
                                
    'product_is_always_free_shipping' => zen_db_prepare_input((int)$_POST['product_is_always_free_shipping']),
                                
    'products_qty_box_status' => zen_db_prepare_input($_POST['products_qty_box_status']),
                                
    'products_quantity_order_max' => zen_db_prepare_input($_POST['products_quantity_order_max']),
                                
    'products_sort_order' => (int)zen_db_prepare_input($_POST['products_sort_order']),
                                
    'products_discount_type' => zen_db_prepare_input($_POST['products_discount_type']),
                                
    'products_discount_type_from' => zen_db_prepare_input($_POST['products_discount_type_from']),
                                
    'products_price_sorter' => zen_db_prepare_input($_POST['products_price_sorter'])
                                );

        
    // when set to none remove from database
        // is out dated for browsers use radio only
          
    $sql_data_array['products_image'] = zen_db_prepare_input($_POST['products_image']);
          
    $new_image'true';

        if (
    $_POST['image_delete'] == 1) {
          
    $sql_data_array['products_image'] = '';
          
    $new_image'false';
        }

        if (
    $_POST['image_delete'] == 1) {
          
    $sql_data_array['products_image'] = '';
          
    $new_image'false';
    }

        if (
    $action == 'insert_product') {
          
    $insert_sql_data = array( 'products_date_added' => 'now()',
                                    
    'master_categories_id' => (int)$current_category_id);

          
    $sql_data_array array_merge($sql_data_array$insert_sql_data);

          
    zen_db_perform(TABLE_PRODUCTS$sql_data_array);
          
    $products_id zen_db_insert_id();

          
    // reset products_price_sorter for searches etc.
          
    zen_update_products_price_sorter($products_id);

          
    $db->Execute("insert into " TABLE_PRODUCTS_TO_CATEGORIES "
                        (products_id, categories_id)
                        values ('" 
    . (int)$products_id "', '" . (int)$current_category_id "')");

          
    ///////////////////////////////////////////////////////
          //// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE //////


          ////    *END OF PRODUCT-TYPE-SPECIFIC INSERTS* ////////
          ///////////////////////////////////////////////////////
        
    } elseif ($action == 'update_product') {
          
    $update_sql_data = array( 'products_last_modified' => 'now()',
                                    
    'master_categories_id' => ($_POST['master_category'] > zen_db_prepare_input($_POST['master_category']) : zen_db_prepare_input($_POST['master_categories_id'])));

          
    $sql_data_array array_merge($sql_data_array$update_sql_data);

          
    zen_db_perform(TABLE_PRODUCTS$sql_data_array'update'"products_id = '" . (int)$products_id "'");

          
    // reset products_price_sorter for searches etc.
          
    zen_update_products_price_sorter((int)$products_id);

          
    ///////////////////////////////////////////////////////
          //// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////


          ////    *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
          ///////////////////////////////////////////////////////
        
    }

        
    $languages zen_get_languages();
        for (
    $i=0$n=sizeof($languages); $i<$n$i++) {
          
    $language_id $languages[$i]['id'];

          
    $sql_data_array = array('products_name' => zen_db_prepare_input($_POST['products_name'][$language_id]),
                                  
    'products_description' => zen_db_prepare_input($_POST['products_description'][$language_id]),
                                  
    'products_url' => zen_db_prepare_input($_POST['products_url'][$language_id]));

          if (
    $action == 'insert_product') {
            
    $insert_sql_data = array('products_id' => (int)$products_id,
                                     
    'language_id' => (int)$language_id);

            
    $sql_data_array array_merge($sql_data_array$insert_sql_data);

            
    zen_db_perform(TABLE_PRODUCTS_DESCRIPTION$sql_data_array);
          } elseif (
    $action == 'update_product') {
            
    zen_db_perform(TABLE_PRODUCTS_DESCRIPTION$sql_data_array'update'"products_id = '" . (int)$products_id "' and language_id = '" . (int)$language_id "'");
          }
        }

        
    // add meta tags
        
    $languages zen_get_languages();
        for (
    $i=0$n=sizeof($languages); $i<$n$i++) {
          
    $language_id $languages[$i]['id'];

          
    $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
                                  
    'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
                                  
    'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));

          if (
    $action == 'insert_product_meta_tags') {

            
    $insert_sql_data = array('products_id' => (int)$products_id,
                                     
    'language_id' => (int)$language_id);

            
    $sql_data_array array_merge($sql_data_array$insert_sql_data);

            
    zen_db_perform(TABLE_META_TAGS_PRODUCTS_DESCRIPTION$sql_data_array);
          } elseif (
    $action == 'update_product_meta_tags') {
            
    zen_db_perform(TABLE_META_TAGS_PRODUCTS_DESCRIPTION$sql_data_array'update'"products_id = '" . (int)$products_id "' and language_id = '" . (int)$language_id "'");
          }
        }
        
        
    // BEGIN CEON URI MAPPING 1 of 1
        
    require_once(DIR_WS_CLASSES 'class.CeonURIMappingAdminProductPages.php');
        
        
    $ceon_uri_mapping_admin = new CeonURIMappingAdminProductPages();
        
        
    $ceon_uri_mapping_admin->updateProductHandler($products_id$zc_products->get_handler($product_type));
        
        
    // END CEON URI MAPPING 1 of 1


        // future image handler code
        
    define('IMAGE_MANAGER_HANDLER'0);
        
    define('DIR_IMAGEMAGICK''');
        if (
    $new_image == 'true' and IMAGE_MANAGER_HANDLER >= 1) {
          
    $srcDIR_FS_CATALOG DIR_WS_IMAGES zen_get_products_image((int)$products_id);
          
    $filename_small$src;
          
    preg_match("/.*\/(.*)\.(\w*)$/"$src$fname);
          list(
    $oiwidth$oiheight$oitype) = getimagesize($src);

          
    $small_widthSMALL_IMAGE_WIDTH;
          
    $small_heightSMALL_IMAGE_HEIGHT;
          
    $medium_widthMEDIUM_IMAGE_WIDTH;
          
    $medium_heightMEDIUM_IMAGE_HEIGHT;
          
    $large_widthLARGE_IMAGE_WIDTH;
          
    $large_heightLARGE_IMAGE_HEIGHT;

          
    $k max($oiheight $small_height$oiwidth $small_width); //use smallest size
          
    $small_width round($oiwidth $k);
          
    $small_height round($oiheight $k);

          
    $k max($oiheight $medium_height$oiwidth $medium_width); //use smallest size
          
    $medium_width round($oiwidth $k);
          
    $medium_height round($oiheight $k);

          
    $large_width$oiwidth;
          
    $large_height$oiheight;

          
    $products_image zen_get_products_image((int)$products_id);
          
    $products_image_extension substr($products_imagestrrpos($products_image'.'));
          
    $products_image_base preg_replace('/'.$products_image_extension.'/'''$products_image);

          
    $filename_medium DIR_FS_CATALOG DIR_WS_IMAGES 'medium/' $products_image_base IMAGE_SUFFIX_MEDIUM '.' $fname[2];
          
    $filename_large DIR_FS_CATALOG DIR_WS_IMAGES 'large/' $products_image_base IMAGE_SUFFIX_LARGE '.' $fname[2];

          
    // ImageMagick
          
    if (IMAGE_MANAGER_HANDLER == '1') {
            
    copy($src$filename_large);
            
    copy($src$filename_medium);
            
    exec(DIR_IMAGEMAGICK "mogrify -geometry " $large_width " " $filename_large);
            
    exec(DIR_IMAGEMAGICK "mogrify -geometry " $medium_width " " $filename_medium);
            
    exec(DIR_IMAGEMAGICK "mogrify -geometry " $small_width " " $filename_small);
          }
        }

        
    zen_redirect(zen_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&pID=' $products_id . (isset($_GET['page']) ? '&page=' $_GET['page'] : '') . (isset($_POST['search']) ? '&search=' $_POST['search'] : '') ));
      } else {
        
    $messageStack->add_session(ERROR_NO_DATA_TO_SAVE'error');
        
    zen_redirect(zen_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&pID=' $products_id . (isset($_GET['page']) ? '&page=' $_GET['page'] : '') . (isset($_POST['search']) ? '&search=' $_POST['search'] : '') ));
      }

    Appreciate your help. Thanks!
    Last edited by saplanet; 14 Jan 2015 at 09:30 AM.

  2. #2
    Join Date
    Jun 2008
    Location
    Singapore, Australia, America
    Posts
    96
    Plugin Contributions
    0

    Default Re: Admin blank page - CEON URL mapping

    I managed to find the problem, but I am not sure if I had solved the problem.

    I reverted this file back to my original edited file: /admin/includes/functions/general.php

    But there are still blank pages whenever I need to update changes on admin (including store setting, layout etc).

  3. #3
    Join Date
    Jul 2012
    Posts
    16,751
    Plugin Contributions
    17

    Default Re: Admin blank page - CEON URL mapping

    Technically this should be discussed in the thread for CEON URI mapping to receive the most visibility and possibility of resolution. Undoing the changes of ZC 1.5.4 is not a proper solution to support a plugin that is not yet uppdated to support ZC 1.5.4. Further because JSWeb has taken over the original product it may be necessary to reach out to them to obtain a proper resolution or to find out their plan for correcting the issue.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Jun 2008
    Location
    Singapore, Australia, America
    Posts
    96
    Plugin Contributions
    0

    Default Re: Admin blank page - CEON URL mapping

    Thank you for the direction, will find the support thread to post it there instead.

  5. #5
    Join Date
    Jun 2008
    Location
    Singapore, Australia, America
    Posts
    96
    Plugin Contributions
    0

    Default Re: Admin blank page - CEON URL mapping

    Oh, but because generally, other admin pages are also going blank after hitting update/confirm, therefore, I wasn’t certain the source of problem.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,603
    Plugin Contributions
    88

    Default Re: Admin blank page - CEON URL mapping

    Quote Originally Posted by saplanet View Post
    Oh, but because generally, other admin pages are also going blank after hitting update/confirm, therefore, I wasn’t certain the source of problem.
    Blank pages === myDEBUG log file generated

    Look in your store's /logs folder for these files that will point you to the offending PHP module/line. If you post the contents of a myDEBUG-adm type file, be sure to xxx-out your admin folder's name first!

  7. #7
    Join Date
    Jun 2008
    Location
    Singapore, Australia, America
    Posts
    96
    Plugin Contributions
    0

    Default Re: Admin blank page - CEON URL mapping

    Quote Originally Posted by lat9 View Post
    Blank pages === myDEBUG log file generated

    Look in your store's /logs folder for these files that will point you to the offending PHP module/line. If you post the contents of a myDEBUG-adm type file, be sure to xxx-out your admin folder's name first!
    I’ve checked many times, there is no myDEBUG log file generated. The actions will still go through, but it just hit a blank page, and I have to go ‘back’ to return to admin; or to re-enter the address bar, and it will return to main admin, instead of where it came from earlier.

  8. #8
    Join Date
    Jul 2012
    Posts
    16,751
    Plugin Contributions
    17

    Default Re: Admin blank page - CEON URL mapping

    Quote Originally Posted by saplanet View Post
    I’ve checked many times, there is no myDEBUG log file generated. The actions will still go through, but it just hit a blank page, and I have to go ‘back’ to return to admin; or to re-enter the address bar, and it will return to main admin, instead of where it came from earlier.
    Saw the other posts, same situation, that there are several reporting blank admin pages (although the thread is completely chaotic with no facts, reproducible actions provided, etc...), and it may have been worthwhile to indicate that attempting to merge CEON URI Mapping into a version not yet supported by the module could lead one to identifying that their issue is with the same software, it further seems that those reporting a blank admin are not having it blank in the same scenario(s) as you've identified.

    FYI, the forum thread for CEON URI Mapping is: http://www.zen-cart.com/showthread.p...I-Mapping-v4-x

    but be forewarned that responses may repeat what I've said above.

    As for the lack of error logs, verify that your logs directory is properly identified in your admin/includes/configure.php file... An example path is provided just above the define for it, be sure that it matches/relates to a true physical directory... (Could also temporarily place a problematic file in your admin/includes/functions/extra_functions file and see if an error log is generated..)

    One last thing, be sure that in your "checking" for the error log(s) that you are looking in the logs folder (I can't see the previous post regarding where to look because I'm in edit mode) previous versions of ZC (1.5.0 and below) used the cache directory.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Jun 2008
    Location
    Singapore, Australia, America
    Posts
    96
    Plugin Contributions
    0

    Default Re: Admin blank page - CEON URL mapping

    Thank you very much for the link to the support thread.

    You are right, my silly. I had someone done the previous upgrade, and I didn’t realise that the debug files are now in /logs, it was in /cache, so there are tons of them since the last upgrade. Will look into them now.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,603
    Plugin Contributions
    88

    Default Re: Admin blank page - CEON URL mapping

    Quote Originally Posted by saplanet View Post
    I’ve checked many times, there is no myDEBUG log file generated. The actions will still go through, but it just hit a blank page, and I have to go ‘back’ to return to admin; or to re-enter the address bar, and it will return to main admin, instead of where it came from earlier.
    One additional thing to try. You'll need to edit /YOUR_ADMIN/includes/application_top.php, starting at line 31:
    Code:
    /**
     * set the level of error reporting
     *
     * Note STRICT_ERROR_REPORTING should never be set to true on a production site. <br />
     * It is mainly there to show php warnings during testing/bug fixing phases.<br />
     * note for strict error reporting we also turn on show_errors as this may be disabled<br />
     * in php.ini. Otherwise we respect the php.ini setting
     *
     */
    if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) {
      @ini_set('display_errors', TRUE);
      error_reporting(version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 5.4, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);
    } else {
      error_reporting(0);
    }
    You'll modify that section to add the line in red:
    Code:
    /**
     * set the level of error reporting
     *
     * Note STRICT_ERROR_REPORTING should never be set to true on a production site. <br />
     * It is mainly there to show php warnings during testing/bug fixing phases.<br />
     * note for strict error reporting we also turn on show_errors as this may be disabled<br />
     * in php.ini. Otherwise we respect the php.ini setting
     *
     */
    define ('STRICT_ERROR_REPORTING', true);
    if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) {
      @ini_set('display_errors', TRUE);
      error_reporting(version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 5.4, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);
    } else {
      error_reporting(0);
    }
    That might point out a PHP error during the initialization process. Don't forget to either remove that line when you're finished or set the constant to false.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v153 Fresh install but CEON URI MAPPING states url already exists..confused.
    By choochoo in forum All Other Contributions/Addons
    Replies: 10
    Last Post: 6 Oct 2014, 10:26 PM
  2. Ceon url mapping url issue
    By Indiasupplement in forum General Questions
    Replies: 1
    Last Post: 22 Sep 2013, 01:23 AM
  3. v150 blank admin page after ceon 4.4.1 install
    By midi73 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 1 Jan 2013, 10:53 PM
  4. Ceon URI Mapping no admin logon page
    By Cuda71 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 19 Nov 2011, 06:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR