Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2013
    Location
    Canada
    Posts
    8
    Plugin Contributions
    0

    Default Admin Error Edit Products - Unable to Determine the Page Link

    Site URL: https://canadaflagshop.com/shop
    Plugins - ckeditor 4.6.2
    PHP Version: 7.2.16 (Zend: 3.2.0)
    MySQL 5.6.40-84.0
    Template: Responsive Sheffield Blue 2.0

    Just upgraded (official procedure) from 1.5.5f to 1.5.6a and front end of site seems to work fine. Only thing I am unable to do is Edit Products in the Admin. When I click on Edit Products for any product I have, I get the following error:


    Error!

    Unable to determine the page link!

    Function used:

    zen_href_link('', 'cPath=2_21&product_type=1&pID=192&action=new_product_preview', 'NONSSL')

    I am able to edit and create categories without any issues. Did not notice these issues when in the testing phase and I have not changed the PHP version since testing. I see lots of references to this type of error that mention an image handler but I am not using one. Any ideas?

  2. #2
    Join Date
    Jul 2012
    Posts
    13,750
    Plugin Contributions
    16

    Default Re: Admin Error Edit Products - Unable to Determine the Page Link

    Which official procedure was used? Meaning could you please elaborate?

    The items listed as currently installed would not have had an effect in this area. What was installed before the upgrade?

    When attempting to edit a product, what is selected to go into the edit area? E.g. The circle E button, anywhere on the row that is not otherwise a link, from say the attributes controller, etc...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3
    Join Date
    Oct 2013
    Location
    Canada
    Posts
    8
    Plugin Contributions
    0

    Default Re: Admin Error Edit Products - Unable to Determine the Page Link

    Used the 3 easy steps to upgrade Zencart. (exported and imported data into new database, ran zc_installer, edited both configure files, changed store name).

    Error only occurs when I am in Catalogue > Categories/Products > Click on the category (product listing) and then I click on the (edit) circle button with the pencil in it. The move, copy, attribute and meta tag buttons all work okay. I can also click on the red status button and activate and deactivate products ok. Just cannot open the edit product listing window.
    Last edited by robertluer; 16 Apr 2019 at 09:07 PM.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    8,389
    Plugin Contributions
    67

    Default Re: Admin Error Edit Products - Unable to Determine the Page Link

    For Zen Cart 1.5.6, there should also be a debug-log in your store's /logs directory that identifies the backtrace of that error. Note that any log information to be posted should be first sanitized, since the log's data will include your store's 'secret' admin directory name.

  5. #5
    Join Date
    Jul 2012
    Posts
    13,750
    Plugin Contributions
    16

    Default Re: Admin Error Edit Products - Unable to Determine the Page Link

    Quote Originally Posted by robertluer View Post
    Used the 3 easy steps to upgrade Zencart. (exported and imported data into new database, ran zc_installer, edited both configure files, changed store name).

    Error only occurs when I am in Catalogue > Categories/Products > Click on the category (product listing) and then I click on the (edit) circle button with the pencil in it. The move, copy, attribute and meta tag buttons all work okay. I can also click on the red status button and activate and deactivate products ok. Just cannot open the edit product listing window.
    What about the files, the above implies that only the database was touched and the two configure.php files.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  6. #6
    Join Date
    Oct 2013
    Location
    Canada
    Posts
    8
    Plugin Contributions
    0

    Default Re: Admin Error Edit Products - Unable to Determine the Page Link

    So checked the myDEBUG and the following error is showing:

    [18-Apr-2019 09:14:09 CST6CDT] Request URI: /testsite/index.php?main_page=product_info&cPath=320&products_id=1285, IP address: 1XX.XX.XX.XX
    --> PHP Fatal error: Uncaught Error: Cannot use string offset as an array in /home/XXXXXXX/public_html/testsite/includes/modules/responsive_sheffield_blue/additional_images.php:120
    Stack trace:
    #0 /home/XXXXXXX/public_html/testsite/includes/templates/template_default/templates/tpl_modules_additional_images.php(13): require()
    #1 /home/XXXXXXX/public_html/testsite/includes/templates/responsive_sheffield_blue/templates/tpl_product_info_display.php(83): require('/home/XXXXXX/...')
    #2 /home/XXXXXXX/public_html/testsite/includes/modules/pages/product_info/main_template_vars.php(177): require('/home/XXXXXXX/...')
    #3 /home/XXXXXXX/public_html/testsite/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php(251): require('/home/XXXXXXX/...')
    #4 /home/XXXXXXX/public_html/testsite/index.php(97): require('/home/XXXXXXX/...')
    #5 {main}
    thrown in /home/XXXXXXX/public_html/testsite/includes/modules/responsive_sheffield_blue/additional_images.php on line 120.

    Here are the contents of additional_images.php file:

    <?php
    /**
    * additional_images module
    *
    * Prepares list of additional product images to be displayed in template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2011 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 $Id: additional_images.php 18697 2011-05-04 14:35:20Z wilt $
    */
    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }
    if (!defined('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE')) define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','Yes');
    $images_array = array();

    // do not check for additional images when turned off
    if ($products_image != '' && $flag_show_product_info_additional_images != 0) {
    // prepare image name
    $products_image_extension = substr($products_image, strrpos($products_image, '.'));
    $products_image_base = str_replace($products_image_extension, '', $products_image);

    // if in a subdirectory
    if (strrpos($products_image, '/')) {
    $products_image_match = substr($products_image, strrpos($products_image, '/')+1);
    //echo 'TEST 1: I match ' . $products_image_match . ' - ' . $file . ' - base ' . $products_image_base . '<br>';
    $products_image_match = str_replace($products_image_extension, '', $products_image_match) . '_';
    $products_image_base = $products_image_match;
    }

    $products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
    if ($products_image_directory != '') {
    $products_image_directory = DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/";
    } else {
    $products_image_directory = DIR_WS_IMAGES;
    }

    // Check for additional matching images
    $file_extension = $products_image_extension;
    $products_image_match_array = array();
    if ($dir = @dir($products_image_directory)) {
    while ($file = $dir->read()) {
    if (!is_dir($products_image_directory . $file)) {
    if (substr($file, strrpos($file, '.')) == $file_extension) {
    if(preg_match('/\Q' . $products_image_base . '\E/i', $file) == 1) {
    if ($file != $products_image) {
    if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {
    // echo 'I AM A MATCH ' . $file . '<br>';
    $images_array[] = $file;
    } else {
    // echo 'I AM NOT A MATCH ' . $file . '<br>';
    }
    }
    }
    }
    }
    }
    if (sizeof($images_array)) {
    sort($images_array);
    }
    $dir->close();
    }
    }

    // Build output based on images found
    $num_images = sizeof($images_array);
    $list_box_contents = '';
    $title = '';

    if ($num_images) {
    $row = 0;
    $col = 0;
    if ($num_images < IMAGES_AUTO_ADDED || IMAGES_AUTO_ADDED == 0 ) {
    $col_width = floor(100/$num_images);
    } else {
    $col_width = floor(100/IMAGES_AUTO_ADDED);
    }

    for ($i=0, $n=$num_images; $i<$n; $i++) {
    $file = $images_array[$i];
    $products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
    // Begin Image Handler changes 1 of 2
    if (function_exists('handle_image')) {
    $newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, '');
    list($src, $alt, $width, $height, $parameters) = $newimg;
    $products_image_large = zen_output_string($src);
    }
    $flag_has_large = file_exists($products_image_large);
    // End Image Handler changes 1 of 2
    $products_image_large = ($flag_has_large ? $products_image_large : $products_image_directory . $file);
    $flag_display_large = (IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE == 'Yes' || $flag_has_large);
    $base_image = $products_image_directory . $file;
    $thumb_slashes = zen_image(addslashes($base_image), addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    // Begin Image Handler changes 2 of 2
    // remove additional single quotes from image attributes (important!)
    $thumb_slashes = preg_replace("/([^\\\\])'/", '$1\\\'', $thumb_slashes);
    // End Image Handler changes 2 of 2
    $thumb_regular = zen_image($base_image, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $large_link = zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large);

    // Link Preparation:
    // bof Zen Colorbox 2012-04-30 niestudio
    if(function_exists('zen_colorbox')){
    include 'zen_colorbox.php';
    } else {
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascriptopupWindow(\\\'' . str_replace($products_image_large, urlencode(addslashes($products_image_large)), $large_link) . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
    }
    // eof Zen Colorbox 2012-04-30 niestudio

    $noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>';

    // $alternate_link = '<a href="' . $products_image_large . '" onclick="javascriptopupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';

    $link = $script_link . "\n " . $noscript_link;
    // $link = $alternate_link;

    // List Box array generation:
    $list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => "\n " . $link);
    $col ++;
    if ($col > (IMAGES_AUTO_ADDED -1)) {
    $col = 0;
    $row ++;
    }
    } // end for loop
    } // endif

  7. #7
    Join Date
    Jul 2012
    Posts
    13,750
    Plugin Contributions
    16

    Default Re: Admin Error Edit Products - Unable to Determine the Page Link

    That debug log is catalog side and not contributing to the issue with the admin reported as the main topic of this thread.

    But, to resolve that issue where it appears that line 120 tries to access $list_box_contents as an array; however, under stricter controls of newer php versions, the previous assignment of that variable to an empty string causes a problem.

    Double check includes/modules/sheffield_responsive/additional_images.php to verify that
    $list_box_contents = array();
    Instead of
    $list_box_contents = '';

    If that file does not exist, then perform the same review/modification in the directory above that...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

 

 

Similar Threads

  1. v155 Error! Unable to determine the page link! when in maintenance mode
    By frank18 in forum General Questions
    Replies: 7
    Last Post: 6 Apr 2017, 12:03 AM
  2. v151 Admin will not display. Error. unable to determine the page link
    By sports guy in forum General Questions
    Replies: 15
    Last Post: 14 Nov 2012, 03:02 AM
  3. Image Handler error: Unable to determine the page link!
    By kernel26 in forum All Other Contributions/Addons
    Replies: 31
    Last Post: 18 Jul 2012, 08:36 PM
  4. Error! Unable to determine the page link!
    By MattBUK in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 7 Feb 2009, 03:57 PM
  5. Currencies: Error! Unable to determine the page link!
    By cdbevan in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 14 Jan 2008, 02:05 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