Problem/Motivation

In any ultimate cron log (admin/config/system/cron/jobs/logs/{ultimate_cron_job}), if you have an error, e.g. a fatal error, then the error message is only shown when you hover on the icon. In that case, the error should replace the normal message.

Current UI:

UI should be something like:

Proposed resolution

- fix it (probably in \Drupal\ultimate_cron\Controller\JobController)
- upload resulting screenshots

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tduong created an issue. See original summary.

tduong’s picture

Issue summary: View changes
tedbow’s picture

Status: Active » Needs review
FileSize
3.66 KB

Here is tests only patch that test for 2 things

  1. That when an exception is thrown during a run the regular success message doesn't show
  2. That the text of the exception shows up on the logs page for the job.

Neither of these pass right now. I think this should be the expected behavior but let me know if not.

Status: Needs review » Needs work

The last submitted patch, 3: logger_errors-2687573-2-TEST_ONLY.patch, failed testing.

tduong’s picture

Issue summary: View changes
FileSize
111.35 KB
132.2 KB

Your test makes sense, but still misses what we want to check.
I've imported your test yaml file, and running your cron job throws the fatal error, correct. What we want to change is when there is such an error, the message in the admin/config/system/cron/jobs/logs/ultimate_cron_logger_test_cron table should be

Call to undefined function ultimate_cron_logger_test_cron() (line 291 of /usr/local/var/www/d8.dev/www/modules/ultimate_cron/src/Entity/CronJob.php).

instead of Launched manually by admin (1). As mentioned in the "proposed solutions" the fix is in JobController, add an additional statement in the check for the message column, something like $log_entry->message == "no info", so the error message should be displayed in the message column.
Anyway, I don't know why the test does not get a fatal error. I've also ran it locally and have the same problem, but when manually testing it, it works as we expected.

Let's fix it first and then ask why the test does not pass.

I've updated and uploaded some screenshot in the summary.

tduong’s picture

Status: Needs work » Needs review
FileSize
8.83 KB
9.95 KB

During manual test I've just imported the yaml text but forgot to enable the test module, that's why the fatal error appeared.
After discussion with @Berdir, he thinks that that yaml file is not needed, so we dropped it. I've reinstalled drupal and enabled the test module and haven't get the fatal error anymore.
Anyway during debug we saw something strange and he said he will take a look on this issue.

Here I've added a fix but IMO it is ugly and too long.

Status: Needs review » Needs work

The last submitted patch, 6: logger_errors-2687573-6.patch, failed testing.

tduong’s picture

Status: Needs work » Needs review
FileSize
4.53 KB

Forgot to reroll the patch...

Status: Needs review » Needs work

The last submitted patch, 8: logger_errors-2687573-8.patch, failed testing.

Berdir’s picture

This didn't work in the test because what you did is throwing an exception not a fatal error. This was also broken though, so I fixed that and did some general cleanup. Also created some follow-ups.

Status: Needs review » Needs work

The last submitted patch, 10: logger_errors-2687573-10.patch, failed testing.

Berdir’s picture

Status: Needs review » Needs work

The last submitted patch, 12: logger_errors-2687573-12.patch, failed testing.

Berdir’s picture

Another follow-up: #2730953: Update hook_watchdog implementation.

Need to figure out the 5.6 error tomorrow on a system that has 5.6

tduong’s picture

Discussed with @Berdir, fixed test.

The last submitted patch, 15: logger_errors-2687573-15-test_only.patch, failed testing.

  • Berdir committed cadfc00 on 8.x-2.x authored by tduong
    Issue #2687573 by tduong, Berdir, tedbow: If an error occur in any...
Berdir’s picture

Status: Needs review » Fixed
Berdir’s picture

Committed.

Status: Fixed » Closed (fixed)

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