[SOLVED] PHP Warning - Error while using Batch to unsubscribe subscribers
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
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.
Replied by Romana on topic PHP Warning - Error while using Batch to unsubscribe subscribers
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
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.
Replied by david-spring on topic [SOLVED] PHP Warning - Error while using Batch to unsubscribe subscribers
Problem solved.
Please Log in or Create an account to join the conversation.
Replied by david-spring on topic [SOLVED] PHP Warning - Error while using Batch to unsubscribe subscribers
Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.295 seconds