Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If there are no content types with newsletter enabled, then when running a simplenews cron job, "Call to a member function getColumns on boolean" is triggered by an entity query:
Comment | File | Size | Author |
---|---|---|---|
Capture du 2017-06-27 12-36-23.png | 185.89 KB | zenimagine | |
Capture du 2017-06-27 01-55-44.png | 267.22 KB | zenimagine | |
Capture du 2017-06-27 01-55-28.png | 224.46 KB | zenimagine |
Comments
Comment #2
jonathanshawComment #3
myriam_b CreditAttribution: myriam_b commentedDo you find a solution ?
Comment #4
GiorgosKmaybe related to this #2893747: Call to a member function getColumns() on boolean ?
Comment #5
subson CreditAttribution: subson as a volunteer commentedin cron run, updateSendStatus() gets called which has below query, but I couldn't find any reference to this field simplenews_issue.status in any tables. Can somebody help explain how and from where this field is used? This query is causing the issue.
$nids = $query
->condition('simplenews_issue.status', SIMPLENEWS_STATUS_SEND_PENDING)
->execute();
and this field_storage in simplenews_form_node_type_submit() is returning NULL before FieldConfig::create();
$field_storage = FieldStorageConfig::loadByName('node', 'simplenews_issue');
I guess this needs to be created somewhere.
Comment #6
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedIt looks like the code
needs to change to
The issue summary doesn't make it clear what the consequences are. Looking at the code in simplenews_cron I would expect that newsletters are still sent, so it doesn't seem like "Major" priority.
Comment #7
marshy_b_2101 CreditAttribution: marshy_b_2101 as a volunteer commentedI'm experiencing the same issue.
Using 8.x-1.0-beta1.
When I attempt to uninstall simplenews via the interface I see:
The following reasons prevent Simplenews from being uninstalled:
There is content for the entity type: Simplenews subscriber. Remove simplenews subscriber entities.
The Simplenews issue field type is used in the following field: node.simplenews_issue
The Simplenews subscription field type is used in the following field: simplenews_subscriber.subscriptions
Additionally, when I attempt to Remove simplenews subscriber entities I geth the following php error:
Uncaught PHP Exception InvalidArgumentException: "The controller for URI "" is not callable." at /mnt/www/html/blahblahblah/docroot/core/lib/Drupal/Core/Controller/ControllerResolver.php...
Comment #8
AdamPS CreditAttribution: AdamPS at AlbanyWeb commented#7 is not the same issue - this issue is about running cron. There is a page to prepare for uninstall /admin/config/services/simplenews/settings/uninstall.
Comment #9
vuilI created the patch for #6 and '8.x-2.x'.
Comment #10
vuilComment #12
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedThanks @ilchovuchkov. Yes you are exactly right that new patches should be for 2.x so I updated the version on the issue. It is sufficient to test with the default test settings so that might save you time instead of running 5 tests.
Comment #13
marshy_b_2101 CreditAttribution: marshy_b_2101 commentedApologies. I understand the uninstall issue is different. I had intended to leave additional info. Not sure where I went wrong.
I attempted uninstall in the first place because I'm receiving:
…
4 /mnt/www/html/blahblahblah/docroot/modules/contrib/simplenews/simplenews.module(313): Drupal\simplenews\Mail\Mailer->updateSendStatus()
#3 /mnt/www/html/blahblahblah/docroot/modules/contrib/simplenews/src/Mail/Mailer.php(403): Drupal\Core\Entity\Query\Sql\Query->execute()
#2 /mnt/www/html/blahblahblah/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(80): Drupal\Core\Entity\Query\Sql\Query->compile()
#1 /mnt/www/html/blahblahblah/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(172): Drupal\Core\Entity\Query\Sql\Condition->compile(Object(Drupal\Core\Database\Driver\mysql\Select))
[09-Aug-2019 14:07:00 UTC] Error: Call to a member function getColumns() on boolean in /mnt/www/html/neiud8/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php on line 252 #0 /mnt/www/html/neiud8/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php(52): Drupal\Core\Entity\Query\Sql\Tables->addField('simplenews_issu...', 'INNER', NULL)
Comment #14
pminf@marshy_b_2101 Please have a look at https://www.drupal.org/project/simplenews/issues/2773403 or open a separate issue about your error during uninstall.
Comment #15
pminfThe Patch from #9 solved this cron issue for me. Not sure why so many tests failed. Could someone please have a look?
Comment #16
jonathanshawMaybe because the issue was marked as being against 1.x but the patch needs 2.x; I've queued for retest, let's see if that does it.
Comment #17
pminfSorry, I was probably too hasty, because the error still persists. Patch from #9 does not solve this cron issue for me.
Comment #18
geek-merlinComment #19
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedThe IS still doesn't describe the sequence of steps to reproduce the bug.
From a PHP shell I can run the command without any problem
Perhaps the bug is only seen with an unusual or corrupted state of field storage or field data?
Comment #20
4kant CreditAttribution: 4kant commentedMaybe this helps someone:
"Simplenews can not be uninstalled. The Simplenews subscription field type is used in the following field: simplenews_subscriber.subscriptions"
Last week I had deleted the content type Newsletter Issue - I guess that was the source. Simplenews-Module isn't needed in this project anymore.
Comment #21
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedI hit this on a site today so I now understand how to reproduce it. The problem occurs if there are no content types with newsletter enabled in which case the simplenews_issue field doesn't exist.
Comment #22
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedSo this is the same as #2974147: Once all newsletter content types have been deleted cannot create a new one - the patch there will ensure that the field storage persists so this will no longer be a problem