kitodo-presentation icon indicating copy to clipboard operation
kitodo-presentation copied to clipboard

[FEATURE] Support for musical sources (and prototype annotations)

Open haogatyp opened this issue 2 years ago • 1 comments

haogatyp avatar Apr 27 '23 14:04 haogatyp

Could you please add the following lines to .github/codeql.yml in order to exempt GridStack and Verovio from automated quality checks?

  - Resources/Public/JavaScript/Gridstack
  - Resources/Public/JavaScript/Verovio

sebastian-meyer avatar Jul 08 '24 13:07 sebastian-meyer

OK, now there are more errors visible formerly hidden by a faulty documentation: There are some cases of calls to non-existing methods and/or properties across multiple files. The reason is, that up until your last changes, there were @property-read ... entries in the docBlock of AbstractDocument for properties which were not actually available in that class (i.e. the measure-related properties). But because of those entries, PHPStan didn't recognize it as an error when those non-existing properties were called. Now that the documentation is correct, those errors are found.

To get rid of them, you have to make sure that the measure-related features are only used for METS documents. So wherever the error arises, you have to check if the given document is a MetsDocument and not just an AbstractDocument before calling any measure-related properties or methods. Otherwise we would run into fatal errors whenever someone tries to access an IiifManifest.

sebastian-meyer avatar Jul 16 '24 10:07 sebastian-meyer

OK, almost there! ;) Only 4 files still have issues:

  • [x] Classes/Common/DocumentAnnotation.php, line 23: This needs a class docBlock
  • [x] Classes/Common/MetsDocument.php, line 284: The @see reference doesn't make sense, because the target doesn't exist
  • [x] Classes/Controller/PageViewController.php, lines 544 + 548: Please check if variable $docMeasures is set (which it is only for MetsDocument)
  • [x] Resources/Public/JavaScript/PageView/ScoreControl.js, line 405: Add a semicolon at the end of the statement

sebastian-meyer avatar Jul 16 '24 14:07 sebastian-meyer

In this case, $docMeasures should always be set, as the getMeasures() method always returns an array. However, the individual components of the array would then be empty if it is not a MetsDocument. Should this be handled differently?

chrizzor avatar Jul 16 '24 15:07 chrizzor