Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2008
    Posts
    139
    Plugin Contributions
    0

    Default Warning and deprecated messages for CSS Flyout menu

    I'm using v157c with Bootstrap template. The CSS Flyout Menu (found here https://www.zen-cart.com/downloads.php?do=file&id=1) installed well on my site, and seems to function well on the user end. But my logs are getting filled with warnings every time a page is called.
    --> PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; zen_categories_ul_generator has a deprecated constructor
    I know it's a pretty old plugin, but I'd like to use it. Is there an update or a relatively easy way to fix that? Thank you.

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    1,905
    Plugin Contributions
    6

    Default Re: Warning and deprecated messages for CSS Flyout menu

    Quote Originally Posted by Joseph M View Post
    I'm using v157c with Bootstrap template. The CSS Flyout Menu (found here https://www.zen-cart.com/downloads.php?do=file&id=1) installed well on my site, and seems to function well on the user end. But my logs are getting filled with warnings every time a page is called.

    I know it's a pretty old plugin, but I'd like to use it. Is there an update or a relatively easy way to fix that? Thank you.
    try changing line 44 of:

    includes/classes/categories_ul_generator.php

    PHP Code:
    //from:
    function zen_categories_ul_generator($load_from_database true) {
    to:
    function 
    __construct($load_from_database true) { 
    best.
    #getAJabWhenYouCan
    if you feel so inclined, feel free to send some cake....

  3. #3
    Join Date
    Apr 2008
    Posts
    139
    Plugin Contributions
    0

    Default Re: Warning and deprecated messages for CSS Flyout menu

    Quote Originally Posted by carlwhat View Post
    try changing line 44 of:

    includes/classes/categories_ul_generator.php

    PHP Code:
    //from:
    function zen_categories_ul_generator($load_from_database true) {
    to:
    function 
    __construct($load_from_database true) { 
    best.
    Worked perfectly. That eliminated the deprecated log warning. Thank you. I am still getting
    A non-numeric value encountered in
    log warning for lines 68 and 100 that I'm trying to make sense of. There were a couple of solutions suggested at https://www.zen-cart.com/showthread....PHP-7-warnings but neither has solved the problem.

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    1,905
    Plugin Contributions
    6

    Default Re: Warning and deprecated messages for CSS Flyout menu

    Quote Originally Posted by Joseph M View Post
    Worked perfectly. That eliminated the deprecated log warning. Thank you. I am still getting log warning for lines 68 and 100 that I'm trying to make sense of. There were a couple of solutions suggested at https://www.zen-cart.com/showthread....PHP-7-warnings but neither has solved the problem.
    the problem deals with php7 and more strict typing of vars. i think if you to the following change on lines 67 and 68, you should be good.

    PHP Code:
    //from:
       
    function buildBranch($parent_id$level 0$submenu=false$parent_link='') {
         
    $result sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' '' );
    //to:
       
    function buildBranch($parent_id$level 0$submenu=false$parent_link='') {
        
    $level = (int)$level;
        
    $result sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' '' ); 
    best.
    #getAJabWhenYouCan
    if you feel so inclined, feel free to send some cake....

  5. #5
    Join Date
    Apr 2008
    Posts
    139
    Plugin Contributions
    0

    Default Re: Warning and deprecated messages for CSS Flyout menu

    Quote Originally Posted by carlwhat View Post
    the problem deals with php7 and more strict typing of vars. i think if you to the following change on lines 67 and 68, you should be good.

    PHP Code:
    //from:
       
    function buildBranch($parent_id$level 0$submenu=false$parent_link='') {
         
    $result sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' '' );
    //to:
       
    function buildBranch($parent_id$level 0$submenu=false$parent_link='') {
        
    $level = (int)$level;
        
    $result sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' '' ); 
    best.
    Right on target again, carlwhat. The site is running the plugin with no warning logs. I'd venture to say that with the two fixes you offered above, you've updated it for v157c.

    Is there a (hopefully simple) way to tell it to exclude categories with a specific category_id? I have it set up to exclude empty categories, but there are some that I don't want the menu to show at all.

  6. #6
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    1,905
    Plugin Contributions
    6

    Default Re: Warning and deprecated messages for CSS Flyout menu

    Quote Originally Posted by Joseph M View Post
    Right on target again, carlwhat. The site is running the plugin with no warning logs. I'd venture to say that with the two fixes you offered above, you've updated it for v157c.

    Is there a (hopefully simple) way to tell it to exclude categories with a specific category_id? I have it set up to exclude empty categories, but there are some that I don't want the menu to show at all.
    with regards to your question, as i tell all my clients, given enough time and money, anything is possible...

    you bring up a couple of interesting points here. i'm not that familiar with the flyout menu plugin, but it makes use of the categories_ul_generator class, which it has packaged in the plugin. but that class is part of the base ZC package which has the changes that i have provided to you. but how that class in the plugin is different from the class packaged with ZC... well you got me.... a diff certainly shows differences, but whether the base class will work with the plugin, i do not know...

    but an interesting issue (at least to me) is the stamping of the class as seen here:

    https://github.com/zencart/zencart/b..._generator.php

    the timestamp from @DrByte says almost 17 years ago; and yet there have been changes made as little as 3 years ago with no corresponding change in the time stamp in the header comments.

    i know the methodology for changing those stamps has changed over the years; and at 1 point i got into a conversation with the team about it. now, i try now to worry about it; but it does seem like this time stamp is blatantly askew as the class packaged with the plugin has a similar date, but yet has not addressed some very basic changes in php that have evolved over the years.

    best.
    #getAJabWhenYouCan
    if you feel so inclined, feel free to send some cake....

 

 

Similar Threads

  1. Support for CSS Flyout Menu
    By Get Em Fast in forum Addon Sideboxes
    Replies: 753
    Last Post: 24 Sep 2013, 04:54 PM
  2. Flyout Menu CSS For My Template.
    By NathanLee0921 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 26 May 2010, 01:24 AM
  3. css flyout menu (for side nav)
    By gsdcypher in forum General Questions
    Replies: 0
    Last Post: 3 Dec 2007, 12:10 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