mjordan / islandora_repository_reports

A Drupal 8 module that provides a collection of graphical reports on various aspects of an Islandora repository.
GNU General Public License v2.0
2 stars 5 forks source link

Whitescreen when viewing reports if repository is empty #34

Closed dannylamb closed 4 years ago

dannylamb commented 4 years ago

Just installed on a fresh (and empty) islandora-playbook instance. Got a WSOD with this in the logs

Drupal\Core\Database\InvalidQueryException: Query condition 'media__field_media_use.field_media_use_target_id IN ()' cannot be empty. in Drupal\Core\Database\Query\Condition->condition() (line 105 of /var/www/html/drupal/web/core/lib/Drupal/Core/Database/Query/Condition.php).
dannylamb commented 4 years ago

I stand corrected, getting that all the time even with content.

mjordan commented 4 years ago

@dannylamb did this happen when you first visited the reports page from the "Reports" admin menu, or after you clicked on the "Go" button?

mjordan commented 4 years ago

I've added check code around any query conditions that use IN. If the list is empty, the plugin returns and empty array and the user should get the message "No [...] data to report on" message. Can you pull in changes to master and test?

dannylamb commented 4 years ago

I didn't get to the "Go" button. I'll test now :+1:

dannylamb commented 4 years ago

Yep! Working now :rocket:

mjordan commented 4 years ago

Very good, thanks for finding this.