Custom Menu Gallery3

76 views
Skip to first unread message

ricki429

unread,
May 29, 2023, 6:47:32 AM5/29/23
to Gallery 3 Users
Now I've upgraded to PHP 8 my custom menu sadly corrupts my Gallery.
Is there any way I can manually at buttons to the Gallery3 menu? 
I've been looking at various files but it doesn't seem possible, but i'm no expert.
Thanks for any help 
Rick

ricki429

unread,
May 29, 2023, 6:49:32 AM5/29/23
to Gallery 3 Users
If activating the Custom Menu module on PHP8.1 it gives the following error:

Error [ 0 ]:Non-static method custom_menus_event_Core::add_sub_menus() cannot be called statically
  1. MODPATH/custom_menus/helpers/custom_menus_event.php[ 42 ]

    37 foreach ($existing_menu as $one_menu) { 38 if ($one_menu->url == "") { 39 $menu->add_after("home", $new_menu = Menu::factory("submenu") 40 ->id("custom_menus-" . $one_menu->id) 41 ->label(t($one_menu->title))); 42 custom_menus_event::add_sub_menus($one_menu->id, $new_menu); 43 } else { 44 $menu->add_after("home", Menu::factory("link") 45 ->id("custom_menus-" . $one_menu->id) 46 ->label(t($one_menu->title)) 47 ->url($one_menu->url));

David and Jackie Armstrong

unread,
May 29, 2023, 8:21:48 AM5/29/23
to gallery...@googlegroups.com
This is a php8 compatibility issue. It is described with potential generic fixes here:

Regards,

David Armstrong.

--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/8fadd0cc-de2a-4b44-8a90-8bb59b12adf1n%40googlegroups.com.
--
Sent from Gmail on iPad

David and Jackie Armstrong

unread,
May 29, 2023, 11:40:08 AM5/29/23
to gallery...@googlegroups.com
Replacing the error line 42 with:

          (new custom_menus_event())->add_sub_menus($one_menu->id, $new_menu);

seems to do the trick. (I hide the home menu and do not use the custom menu so have not tested the module fully, but it did work when I disabled the No Home Menu module and added a top level menu link to the enabled Custom Menu).

Regards,

David Armstrong.

On Mon, 29 May 2023 at 11:49, ricki429 <rickin...@gmail.com> wrote:
--

ricki429

unread,
May 29, 2023, 2:05:39 PM5/29/23
to Gallery 3 Users
Thank you that has worked great! Didn't think it would be that easy! Thank you again!

J.R.

unread,
May 30, 2023, 3:25:08 PM5/30/23
to gallery...@googlegroups.com
Rick,

Huh. Never seen a request to do this before -- I'm inclined to say "no, not possible" but I suppose if you were good at script editing and PHP coding that you could directly modify one of PHP files to add a button... but I have no idea which file to edit or what the code might be like. If you had a custom menu in your gallery before going to PHP 8 you might try showing the code for that customization to see if someone here might know how to help upgrade it.

-- J.R.
Rick --
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

ricki429

unread,
Jun 6, 2023, 8:15:48 AM6/6/23
to Gallery 3 Users
David

I think im having the same issue with Latest Updates module.
I tried adapting what you sugested to this module which didn't work.
Any sugestions?

Error [ 0 ]:Attempt to assign property "next_page_link" on null
  1. MODPATH/latestupdates/controllers/latestupdates.php[ 297 ]

    292 $previous_page = $page - 1; 293 $view->previous_page_link = url::site("latestupdates/updates?page={$previous_page}"); 294 } 295 if ($page < $max_pages) { 296 $next_page = $page + 1; 297 $view->next_page_link = url::site("latestupdates/updates?page={$next_page}"); 298 } 299 300 // Set up and display the actual page. 301 $root = item::root(); 302 $template = new Theme_View("page.html", "collection", "LatestUpdates");
  2. {PHP internal call} » latestupdates_Controller->updates()

  3. SYSPATH/core/Kohana.php[ 302 ] » ReflectionMethod->invokeArgs()

  4. SYSPATH/core/Event.php[ 208 ] » Kohana_Core::instance()

  5. APPPATH/Bootstrap.php[ 67 ] » Event_Core::run()

  6. DOCROOT/index.php[ 124 ] » require( arguments )


On Monday, May 29, 2023 at 4:40:08 PM UTC+1 David and Jackie Armstrong wrote:

David and Jackie Armstrong

unread,
Jun 7, 2023, 5:53:16 AM6/7/23
to gallery...@googlegroups.com
I would first try replacing the module with the one from Brad Dutton’s GitHub repository as for this module it appears more recent than the version in 3.1.5

Regards,

David Armstrong.



David and Jackie Armstrong

unread,
Jun 13, 2023, 1:50:42 PM6/13/23
to gallery...@googlegroups.com
I spent some more time looking at this module, which I do not use but does work on my site www.thejigasaurus.com when using the Brad Dutton version. This version comments out the pagination links that are giving you the error:

    // Set up the previous and next page buttons.
    if ($page > 1) {

      $previous_page = $page - 1;
#      $view->previous_page_link = url::site("latestupdates/updates?page={$previous_page}");
    }
    if ($page < $max_pages) {

      $next_page = $page + 1;
#      $view->next_page_link = url::site("latestupdates/updates?page={$next_page}");
    }

Let me know how you get on.

Regards,

David Armstrong

On Tue, 6 Jun 2023 at 13:15, ricki429 <rickin...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages