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

Regression: media-type option on digital object deriv regeneration task no longer works #1643

Closed
fiver-watson opened this issue Aug 16, 2023 · 1 comment · Fixed by #1657
Closed
Assignees
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Milestone

Comments

@fiver-watson
Copy link
Contributor

Current Behavior

As part of release 2.6.0 and in preparation for the replacement of the legacy Flash-based media player, Feature #12903 was developed, adding a new --media-type option to the digital object derivatives regeneration task. This option allows users to specify a media type (e.g. audio, video, image, text, other) and limit regeneration of DO derivatives to just the selected type.

...in theory. At present, in qa/2.x (post 2.7.3 release), this option is no longer working as intended.

First reported in the AtoM user forum 2023-08-14; reproduced by DG in the AtoM-Docker local test env (on qa/2.x) 2023-08-16.

Steps to reproduce the behavior

  1. Make sure you have some archival descriptions in your test environment with digital objects of a few different media types attached (e.g. images, video, etc)
  2. Run the task using the --media-type option to limit the generation to video:
php symfony digitalobject:regen-derivatives --media-type="video"

Error encountered

The task generates derivatives for ALL digital objects, rather than just the selected media type. Sample output from local testing:

dgillean@fiver-work:~/Desktop/atom-docker/atom$ DS digitalobject:regen-derivatives --media-type="video"
                                                                             
  Continuing will regenerate the derivatives for video digital objects       
  This will PERMANENTLY DELETE existing derivatives you chose to regenerate  
                                                                             
  Continue? (y/N)                                                            
                                                                             
y
>> digital object Regenerating derivatives for dibujo_animado_lindo_de_tocino_y_del_huevo_tarjeta_postal-rd9d6d99a0833431cbd8a6655ad6d3725_vgbaq_8byvr_324.jpg... (1.81s)
>> digital object Regenerating derivatives for il_340x270.473520073_izfa.jpg... (2.63s)
>> digital object Regenerating derivatives for weird_wonderful_bunnies_rabbit_asleep.jpg... (3.09s)
>> digital object Regenerating derivatives for bunny-bow.jpg... (3.66s)
>> digital object Regenerating derivatives for fox-bunny.jpg... (3.93s)
>> digital object Regenerating derivatives for NomNomNom.jpg... (4.2s)
>> digital object Regenerating derivatives for sassy-bunny.jpg... (4.37s)
>> digital object Regenerating derivatives for the_tiniest.jpg... (4.55s)
>> digital object Regenerating derivatives for sample-mp4-file.mp4... (4.91s)
>> digital object Please update the search index manually to reflect any changes
>> digital object Done!

Expected Behavior

AtoM will only regenerate the digital object derivatives for the selected media type

Possible Solution

No response

Context and Notes

See documentation for the related task here:

Version used

qa/2.x - AtoM settings page reads: 2.8.0 - 193

Operating System and version

Docker env

Default installation culture

en

PHP version

7.4

Contact details

No response

@fiver-watson fiver-watson added the Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result. label Aug 16, 2023
@anvit anvit added this to the 2.8.0 milestone Sep 11, 2023
@anvit anvit self-assigned this Sep 15, 2023
@anvit
Copy link
Contributor

anvit commented Sep 15, 2023

My guess is that the query here is malformed, and the condition for media-types doesn't end up after the where clause.

anvit added a commit that referenced this issue Sep 15, 2023
Add conditions for the regen task SQL query to whereClauses to ensure
that they end up after the keyword WHERE instead of manually appending
them to the query.
@anvit anvit linked a pull request Sep 15, 2023 that will close this issue
anvit added a commit that referenced this issue Oct 3, 2023
Add conditions for the regen task SQL query to whereClauses to ensure
that they end up after the keyword WHERE instead of manually appending
them to the query.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants