[SOLVED] PHP Warning - Error while using Batch to unsubscribe subscribers

02 Feb 2021 06:47 #1914 by david-spring

  • New Member
  • New Member

  • Posts: 2
  • Thank you received: 0
  • On two different websites, I have gotten the following error while trying to unsubscribe a subscriber using the Batch Unsubscribe tool.
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 3
    Message: Batch processing „Remove subscribers from mailing list with ID 2“ finished. One subscriber removed. There were no subscribers, that were subscribed to this mailing list.
    In examining the Joomla Administration error log, it recorded the following BW Postman PHP warning:
    [02-Feb-2021 01:36:58 UTC] PHP Warning: explode() expects parameter 2 to be string, array given in /home/savenwor/public_html/administrator/components/com_bwpostman/tables/subscribers_mailinglists.php on line 179
    Here are lines 169 to 195. Line 179 begins with $query->where($db->quoteName('mailinglist_id') :
    public function deleteMailinglistsOfSubscriber($subscriber_id, $mailinglists = null)
    {
    $db = $this->_db;
    $query = $db->getQuery(true);
    $query->delete($db->quoteName($this->_tbl));
    $query->where($db->quoteName('subscriber_id') . ' = ' . (int) $subscriber_id);
    if (!is_null($mailinglists))
    {
    $query->where($db->quoteName('mailinglist_id') . ' IN ' . (explode('.', $mailinglists)));}
    try
    {
    $db->setQuery($query);
    $db->execute();
    return true; }
    catch (RuntimeException $e)
    {
    Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');
    return false; } }

    I am not an expert on PHP but apparently parameter 2 is supposed to be a string and the error log indicates it might be an array instead.
    This error appeared shortly after we updated to BW Postman version 3.1.1. But it also appeared shortly after we updated from PHP 7.2 to PHP 7.3. We want to stay with PHP 7.3 because PHP 7.2 is no longer supported. If you want, we would be willing to update to PHP 7.4. This also happened around the time we updated to Joomla 3.9.24
    We are hoping you can come up with a solution to this problem as we are unable to unsubscribe people from our email list until this problem is solved.
    Regards,
    David Spring

    Please Log in or Create an account to join the conversation.

    02 Feb 2021 10:20 #1915 by Romana

    • Moderator
    • Moderator

  • Posts: 963
  • Thank you received: 86
  • Hello David,

    yes, You found a bug. I have fixed this bug already, but some tests are missing.

    The next some days there will be published the fixed version 3.1.2.

    Kind regards
    Romana

    Problem gelöst? Dann bitte auf gelöst klicken. Über ein Danke freue ich mich immer.
    Problem solved? Please click to solved.I am glad to every thank you.

    Please Log in or Create an account to join the conversation.

    02 Feb 2021 17:19 #1916 by david-spring

    • New Member
    • New Member

  • Posts: 2
  • Thank you received: 0
  • Please Log in or Create an account to join the conversation.

    02 Feb 2021 17:20 #1917 by david-spring

    • New Member
    • New Member

  • Posts: 2
  • Thank you received: 0
  • Please Log in or Create an account to join the conversation.

    Time to create page: 0.236 seconds

    Register to newsletter

    Hint: Your entered data are only used to register to and sending of the newsletter. Your data will be processed and stored by me. For more information have a look at my privacy policy.
    Your mailing list:
    BwPostman:
    Infos about Joomla! extensions of Boldt Webservice...

    () Mandatory fields

    Information

    ×

    Voluntary salary

    If you like Boldt Webservice then I would be glad about your backing:
    • Recommend Boldt Webservice.
    • If you want to support my work with a donation, please click on the following button - the donation will be handled via paypal.

    With your voluntary salary you also support the development of free software and extensions for the CMS Joomla.

    Enter your amount below and click on the following button:

     

    Register to newsletter

    Hint: Your entered data are only used to register to and sending of the newsletter. Your data will be processed and stored by me. For more information have a look at my privacy policy.
    Your mailing list:
    BwPostman:
    Infos about Joomla! extensions of Boldt Webservice...

    () Mandatory fields

    Information

    ×

    Voluntary salary

    If you like Boldt Webservice then I would be glad about your backing:
    • Recommend Boldt Webservice.
    • If you want to support my work with a donation, please click on the following button - the donation will be handled via paypal.

    With your voluntary salary you also support the development of free software and extensions for the CMS Joomla.

    Enter your amount below and click on the following button: