Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PUID data source thows error #2

Open
mjordan opened this issue Apr 25, 2020 · 1 comment
Open

PUID data source thows error #2

mjordan opened this issue Apr 25, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@mjordan
Copy link
Owner

mjordan commented Apr 25, 2020

As of roblib/islandora_fits@004f269, fields from the FITS data are not being added to media, so our query on fits_droid_puid fails with:

[Sat Apr 25 15:50:46.015467 2020] [php7:notice] [pid 2711] [client 10.0.2.2:41652] Uncaught PHP Exception Drupal\\Core\\Entity\\Query\\QueryException: "'fits_droid_puid' not found" at /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php line 367, referer: http://localhost:8000/admin/reports/media_formats

The best way to check whether a field exists is using code like:

  $schema = \Drupal\Core\Database\Database::getConnection()->schema();
  $tables = rest_oai_pmh_schema();
  foreach ($tables as $name => $table) {
    if (!$schema->tableExists($name)) {
      $schema->createTable($name, $table);
    }
  }

The Islandora FITS module doesn't provide a schema, since the fields are dynamically generated. So, in the absense of the fits_droid_puid field, the current PUID data source won't work.

@mjordan
Copy link
Owner Author

mjordan commented Apr 25, 2020

Once I figure out how to test for the presence of the fits_droid_puid field in the absence of a schema, I can put back the PUID data source.

@mjordan mjordan transferred this issue from mjordan/media_formats_reports May 9, 2020
@mjordan mjordan added the bug Something isn't working label May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant