• Resolved sigcps

    (@sigcps)


    Hello,
    I have an error message that I don’t understand :

    Warning: Undefined variable $results in C:\Apache24\htdocs\portail\wp-content\plugins\media-library-assistant\includes\class-mla-data-source.php on line 742

    Warning: Trying to access array offset on value of type null in C:\Apache24\htdocs\portail\wp-content\plugins\media-library-assistant\includes\class-mla-data-source.php on line 742

    the problem appears on a page where the following shortcode is used:

    [mla_gallery]

    class_bouton=”noir mini”

    mla_style=”liste-perso”

    mla_markup=”liste-media”

    attachment_category=”amenagement”

    orderby=”name ASC”

    [/mla_gallery]

    WordPress : 6.7.1 / plugin : 3.24 / theme : ASTRA – 4.8.9

    Thanks!

    • This topic was modified 1 year, 5 months ago by sigcps.
    • This topic was modified 1 year, 5 months ago by sigcps.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your question, and for including the complete text of your shortcode; very helpful.

    I believe the issue is caused by an element of your “liste-media” markup template, which you did not include in your post. It looks like you are trying to access the file_size field-level data source somewhere in your template; is that right?

    In any case, you have exposed a defect in the current MLA version. There is a typographic error in the code that causes the warning messages you posted.

    I have uploaded a new MLA Development Version dated 20250106 that corrects the problem. You can find step-by-step instructions for using the Development Version in this earlier topic:

    How to download & install the current development version of MLA

    Once the Development Version is installed you can retest the handling of the file_size data source in your template.

    The fix will be part of my next MLA version, but in the interim it would be great if you could install the Development Version and let me know if it works for you. Thanks for alerting me to this MLA defect.

    Thread Starter sigcps

    (@sigcps)

    Hello David,

    I have a new error message (astra theme version is now 4.8.10) :

    Fatal error: Uncaught TypeError: Cannot access offset of type string on string in C:\Apache24\htdocs\portail\wp-content\plugins\media-library-assistant\includes\class-mla-data-source.php:742 Stack trace: #0 C:\Apache24\htdocs\portail\wp-content\plugins\media-library-assistant\includes\class-mla-data-source.php(189): MLAData_Source::_evaluate_data_source(303, ‘single_attachme…’, Array, Array) #1 C:\Apache24\htdocs\portail\wp-content\plugins\media-library-assistant\includes\class-mla-shortcodes.php(381): MLAData_Source::mla_get_data_source(303, ‘single_attachme…’, Array, NULL) #2 C:\Apache24\htdocs\portail\wp-content\plugins\media-library-assistant\includes\class-mla-data.php(1718): MLAShortcodes::mla_get_data_source(303, ‘single_attachme…’, Array) #3 C:\Apache24\htdocs\portail\wp-content\plugins\media-library-assistant\includes\class-mla-shortcode-support.php(1437): MLAData::mla_expand_field_level_parameters(‘<a class=”galle…’, Array, Array, 303) #4 C:\Apache24\htdocs\portail\wp-content\plugins\media-library-assistant\includes\class-mla-shortcodes.php(109): MLAShortcode_Support::mla_gallery_shortcode(Array, ‘<br>class_bouto…’) #5 C:\Apache24\htdocs\portail\wp-includes\shortcodes.php(434): MLAShortcodes::mla_gallery_shortcode(Array, ‘<br>class_bouto…’, ‘mla_gallery’) #6 [internal function]: do_shortcode_tag(Array) #7 C:\Apache24\htdocs\portail\wp-includes\shortcodes.php(273): preg_replace_callback(‘/\\[(\\[?)(mla_ga…’, ‘do_shortcode_ta…’, ‘<div class=”wp-…’) #8 C:\Apache24\htdocs\portail\wp-includes\class-wp-hook.php(324): do_shortcode(‘<div class=”wp-…’) #9 C:\Apache24\htdocs\portail\wp-includes\plugin.php(205): WP_Hook->apply_filters(‘<div class=”wp-…’, Array) #10 C:\Apache24\htdocs\portail\wp-includes\post-template.php(256): apply_filters(‘the_content’, ‘<!– wp:uagb/fa…’) #11 C:\Apache24\htdocs\portail\wp-content\themes\astra\template-parts\single\content-header.php(37): the_content() #12 C:\Apache24\htdocs\portail\wp-includes\template.php(812): require(‘C:\\Apache24\\htd…’) #13 C:\Apache24\htdocs\portail\wp-includes\template.php(745): load_template(‘C:\\Apache24\\htd…’, false, Array) #14 C:\Apache24\htdocs\portail\wp-includes\general-template.php(206): locate_template(Array, true, false, Array) #15 C:\Apache24\htdocs\portail\wp-content\themes\astra\inc\template-parts.php(374): get_template_part(‘template-parts/…’) #16 C:\Apache24\htdocs\portail\wp-includes\class-wp-hook.php(324): astra_entry_content_single_page_template(”) #17 C:\Apache24\htdocs\portail\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(”, Array) #18 C:\Apache24\htdocs\portail\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #19 C:\Apache24\htdocs\portail\wp-content\themes\astra\inc\core\theme-hooks.php(450): do_action(‘astra_entry_con…’) #20 C:\Apache24\htdocs\portail\wp-content\themes\astra\template-parts\content-page.php(28): astra_entry_content_single_page() #21 C:\Apache24\htdocs\portail\wp-includes\template.php(812): require(‘C:\\Apache24\\htd…’) #22 C:\Apache24\htdocs\portail\wp-includes\template.php(745): load_template(‘C:\\Apache24\\htd…’, false, Array) #23 C:\Apache24\htdocs\portail\wp-includes\general-template.php(206): locate_template(Array, true, false, Array) #24 C:\Apache24\htdocs\portail\wp-content\themes\astra\inc\class-astra-loop.php(110): get_template_part(‘template-parts/…’, ‘page’) #25 C:\Apache24\htdocs\portail\wp-includes\class-wp-hook.php(324): Astra_Loop->template_parts_page(”) #26 C:\Apache24\htdocs\portail\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(”, Array) #27 C:\Apache24\htdocs\portail\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #28 C:\Apache24\htdocs\portail\wp-content\themes\astra\inc\class-astra-loop.php(198): do_action(‘astra_page_temp…’) #29 C:\Apache24\htdocs\portail\wp-content\themes\astra\inc\class-astra-loop.php(175): Astra_Loop->loop_markup(true) #30 C:\Apache24\htdocs\portail\wp-includes\class-wp-hook.php(324): Astra_Loop->loop_markup_page(”) #31 C:\Apache24\htdocs\portail\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(”, Array) #32 C:\Apache24\htdocs\portail\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #33 C:\Apache24\htdocs\portail\wp-content\themes\astra\inc\core\theme-hooks.php(265): do_action(‘astra_content_p…’) #34 C:\Apache24\htdocs\portail\wp-content\themes\astra\page.php(32): astra_content_page_loop() #35 C:\Apache24\htdocs\portail\wp-includes\template-loader.php(106): include(‘C:\\Apache24\\htd…’) #36 C:\Apache24\htdocs\portail\wp-blog-header.php(19): require_once(‘C:\\Apache24\\htd…’) #37 C:\Apache24\htdocs\portail\index.php(17): require(‘C:\\Apache24\\htd…’) #38 {main} thrown in C:\Apache24\htdocs\portail\wp-content\plugins\media-library-assistant\includes\class-mla-data-source.php on line 742

    Plugin Author David Lingren

    (@dglingren)

    Thank you for taking the time to install and test the Development Version. I regret that my original fix was flawed. I have updated the code and that should give you a better result.

    I have uploaded a new MLA Development Version dated 20250109 that corrects the problem. You can find step-by-step instructions for using the Development Version in the earlier topic I referenced above

    Once the new Development Version is installed you can retest the handling of the file_size data source in your template.

    The fix will be part of my next MLA version, but in the interim it would be great if you could install the new Development Version and let me know if it works for you. Thanks for working with me on this MLA defect.

    Thread Starter sigcps

    (@sigcps)

    Hello David,

    This time everything works, thank you very much!

    Hello everyone !

    @dglingren you guess right, here is a part of the template used :

    <span class="gallery_size">[+file_size,kbmb(1024,ko,Mo,2)+]</span>

    Thank you very much for the reactivity, much appreciated !!

    Best regards
    Arthur Bazin

    Plugin Author David Lingren

    (@dglingren)

    I have released MLA v3.25, which contains the fix for this problem.

    I am marking the topic resolved, but please update it if you have any problems or further questions regarding the file_size data source. Thanks for helping me find and fix this MLA defect.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Issue with Astra’ is closed to new replies.