• Resolved Marc_O

    (@marc_o)


    Hello,

    I’m using the Acymailing widget for several years but lately (since the last version perhaps), the widget breaks the page it was into.

    The widget was included with this shortcode [widget id=”acym_archive_widget-2″]. I wanted to try by including as a widget in the sidebar but when I got in the widgets area in the back office, the Acymailing widget breaks everything here too. I don’t have the widgets page but the start of the widget with the search bar then a message of wordpress that say there is an error on the website.

    Can you please tell me if something changes in the widget code that could explain that?

    Regards

    • This topic was modified 11 months, 1 week ago by Marc_O.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support jeremyacy

    (@jeremyacy)

    Hello,

    Do you have a PHP error message? You can activate the WordPress error logging by adding this in your wp-config.php file:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    Make sure no other line exists for the “WP_DEBUG” definition, in recent versions of wordpress they added one.

    When an error occurs on your site, a file will be created/updated in wp-content/debug.log.

    Thread Starter Marc_O

    (@marc_o)

    Hello,

    Thank you for your anwer.

    This is the debug log I got when I try to go to the Widgets page.
    Do you see what is the issue here?

    [26-Dec-2023 13:43:08 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 7241
    [26-Dec-2023 13:43:08 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 2187
    [26-Dec-2023 13:43:08 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 7241
    [26-Dec-2023 13:43:08 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 2187
    [26-Dec-2023 13:43:08 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 7241
    [26-Dec-2023 13:43:08 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 2187
    [26-Dec-2023 13:43:08 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 7241
    [26-Dec-2023 13:43:08 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 2187
    [26-Dec-2023 13:43:20 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 7241
    [26-Dec-2023 13:43:20 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 2187
    [26-Dec-2023 13:43:20 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 7241
    [26-Dec-2023 13:43:20 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 2187
    [26-Dec-2023 13:43:20 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 7241
    [26-Dec-2023 13:43:20 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 2187
    [26-Dec-2023 13:43:20 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 7241
    [26-Dec-2023 13:43:20 UTC] PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /homepages/3/d366098090/htdocs/site-wp/wp-includes/functions.php on line 2187
    [26-Dec-2023 13:43:20 UTC] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string / string in /homepages/3/d366098090/htdocs/site-wp/wp-content/plugins/acymailing/back/helpers/pagination.php:24
    Stack trace:
    #0 /homepages/3/d366098090/htdocs/site-wp/wp-content/plugins/acymailing/front/views/archive/tmpl/listing.php(43): AcyMailing\Helpers\PaginationHelper->display()
    #1 /homepages/3/d366098090/htdocs/site-wp/wp-content/plugins/acymailing/back/libraries/view.php(115): include('/homepages/3/d3...')
    #2 /homepages/3/d366098090/htdocs/site-wp/wp-content/plugins/acymailing/back/libraries/controller.php(204): AcyMailing\Libraries\acymView->display()
    #3 /homepages/3/d366098090/htdocs/site-wp/wp-content/plugins/acymailing/front/controllers/archive.php(163): AcyMailing\Libraries\acymController->display()
    #4 /homepages/3/d366098090/htdocs/site-wp/wp-content/plugins/acymailing/widgets/archive/widget.php(125): AcyMailing\FrontControllers\ArchiveController->showArchive()
    #5 /homepages/3/d366098090/htdocs/site-wp/wp-includes/class-wp-widget.php(394): acym_archive_widget->widget()
    #6 /homepages/3/d366098090/htdocs/site-wp/wp-includes/widgets.php(2026): WP_Widget->display_callback()
    #7 /homepages/3/d366098090/htdocs/site-wp/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php(697): wp_render_widget()
    #8 /homepages/3/d366098090/htdocs/site-wp/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php(154): WP_REST_Widgets_Controller->prepare_item_for_response()
    #9 /homepages/3/d366098090/htdocs/site-wp/wp-includes/rest-api/class-wp-rest-server.php(1193): WP_REST_Widgets_Controller->get_items()
    #10 /homepages/3/d366098090/htdocs/site-wp/wp-includes/rest-api/class-wp-rest-server.php(1041): WP_REST_Server->respond_to_request()
    #11 /homepages/3/d366098090/htdocs/site-wp/wp-includes/rest-api.php(551): WP_REST_Server->dispatch()
    #12 /homepages/3/d366098090/htdocs/site-wp/wp-includes/rest-api.php(2918): rest_do_request()
    #13 [internal function]: rest_preload_api_request()
    #14 /homepages/3/d366098090/htdocs/site-wp/wp-includes/block-editor.php(753): array_reduce()
    #15 /homepages/3/d366098090/htdocs/site-wp/wp-admin/widgets-form-blocks.php(26): block_editor_rest_api_preload()
    #16 /homepages/3/d366098090/htdocs/site-wp/wp-admin/widgets.php(32): require('/homepages/3/d3...')
    #17 {main}
      thrown in /homepages/3/d366098090/htdocs/site-wp/wp-content/plugins/acymailing/back/helpers/pagination.php on line 24

    Thank you

    Plugin Support jeremyacy

    (@jeremyacy)

    It seems that the data passed to the pagination is incorrect.

    Could you edit the file wp-content/plugins/acymailing/back/helpers/pagination.php and just before the line 24:

    $nbPages = ceil($this->total / $this->nbPerPage);

    Add this code:

    $this->total = intval($this->total);
    $this->nbPerPage = intval($this->nbPerPage);
    if(empty($this->nbPerPage)){
        return '';
    }

    This should resolve the issue. This code will be included in the next version.

    Thread Starter Marc_O

    (@marc_o)

    Hello,

    Thank you for the snippet, I confirm that it fixed the issue.

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Acmailing Widget not working, its breaks the page’ is closed to new replies.