Problem/Motivation

After disabling DANSE log -module got these errors and white screen on /admin/reports/danse

Error: Class "Drupal\danse_log\Payload" not found in Drupal\danse\PayloadBase::fromArray() (line 18 of /var/www/html/site/web/modules/contrib/danse/src/PayloadBase.php)
#0 /var/www/html/site/web/modules/contrib/danse/src/Entity/Event.php(86): Drupal\danse\PayloadBase::fromArray()
#1 /var/www/html/site/web/modules/contrib/danse/src/Plugin/views/field/EventLabel.php(20): Drupal\danse\Entity\Event->getPayload()...

Steps to reproduce

Enable

1. DANSE Content, danse Log, danse user and the main module.
2. Not sure is this needed, Add to default comments create event: create, publish
3. access to /admin/reports/danse and it is showing log events
4. Uninstall danse log -module
5. clear caches, and try to access to /admin/reports/danse - does not work

ALSO, if running "drush cron" gives error:

TypeError: Drupal\danse\PluginBase::subscriptionKey(): Argument #2 must be of type string, null given, called in /var/www/html/site/web/modules/contrib/danse/modules/content/src/Payload.php on line 68 in Drupal\danse\PluginBase->subscriptionKey() (line 231 of /var/www/html/site/web/modules/contrib/danse/src/PluginBase.php) #0 /var/www/html/site/web/modules/contrib/danse/modules/content/src/Payload.php(68): Drupal\danse\PluginBase->subscriptionKey()

Tried to fix the situation:
1. Enabled the module Danse Log again, and the /admin/reports/danse started to work.
But the site cron is not running, running cron gives the same error message as mentioned above and white screen, so the site is unusable.
2. Uninstalled all Danse modules and the main module, and cron is able to run again

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork danse-3306168

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Youcanlearnit created an issue. See original summary.

Youcanlearnit’s picture

Issue summary: View changes
Youcanlearnit’s picture

Issue summary: View changes
Youcanlearnit’s picture

Issue summary: View changes
jurgenhaas’s picture

Hmm, OK that sounds as if there are events and notification entities left behind that belong to the log module and since that's gone, the error may be explainable.

To prevent that from happening, we could potentially delete all log module related events and notifications. On the other hand, there could be so many of them, that this could easily run into a time-out which will cause even more potential damage.

This is one more of those examples, why I think, uninstalling modules is just a bad idea. There should be some guidelines that explain, that testing modules should be done in a development environment, where all this doesn't matter. There, you could always roll back to a previous state when restoring a db backup.

We can instead try and catch the exception so that at least the site would continue to work in such a scenario.

jurgenhaas’s picture

Version: 2.2.6 » 2.2.x-dev
Status: Active » Needs review

I've implemented some safeguards, please give it a try if that helps.

jurgenhaas’s picture

Priority: Minor » Normal

Have just extended the MR to cover more similar cases.

jurgenhaas’s picture

Status: Needs review » Fixed

Unfortunately, haven't received any feedback to this bug fix. Merged it after reviewing it again myself.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.