-
Notifications
You must be signed in to change notification settings - Fork 31
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
Islandora 2136 #95
base: 7.x
Are you sure you want to change the base?
Islandora 2136 #95
Changes from 3 commits
491938b
3716d45
2548b6c
555f8d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,13 +36,16 @@ function islandora_ocr_enable() { | |
*/ | ||
function islandora_ocr_cleanup_derivatives() { | ||
if (module_exists('islandora_book')) { | ||
$book = variable_get('islandora_book_ingest_derivatives'); | ||
$book = variable_get('islandora_book_ingest_derivatives', array( | ||
'pdf' => 'pdf', | ||
'image' => 'image', | ||
'ocr' => FALSE)); | ||
$book['ocr'] = FALSE; | ||
variable_set('islandora_book_ingest_derivatives', $book); | ||
} | ||
|
||
if (module_exists('islandora_newspaper')) { | ||
$newspaper = variable_get('islandora_newspaper_ingest_derivatives'); | ||
$newspaper = variable_get('islandora_newspaper_ingest_derivatives', array('ocr' => FALSE)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @robyj Based on the above change and the default from the newspaper solution pack's admin page I think you should just do that same as above and set
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
$newspaper['ocr'] = FALSE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also happens here. Now I wonder if the issue is different. Do we have something in islandora_newspaper or 'islandora_book' that helps us set those defaults, quick look tells me this is hardcoded in some form options? What if someone changes those defaults or allows a new one?. Will we ever remember we need to change them here too? So if this piece of code only cares about ocr, would it be not better to default to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, I pulled that default value of just array('ocr') from what seemed to be another place it was being set by default. I'd just like it to be correct. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @robyj totally. I get it!, I also saw it as only array('ocr') somewhere else (zip importer for newspapers?). The issue is, defaulting here makes almost little sense. Defaulting makes sense when load of variable needs to be consistent with the whole expectation and the logic that comes after. In this case you only want to set ocr to false if the variable is set at all right? So i dare to question, why to even save in case the variable was not set? @whikloj thoughts? In any case nothing here is life or dead, but still this needs to A) respect what was set, B) reset the OCR to false C) if nothing was there, better leave it like that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those settings of However in this case because we are unsure if we are getting the default or the users setting we have to do the If that makes this too confusing then perhaps just doing a That would match how the default is set in the newspaper solution pack. https://github.com/Islandora/islandora_solution_pack_newspaper/blob/7.x/includes/admin.form.inc#L36-L37 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I should have said that we would then still explicitly set the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, I pulled that default value of just array('ocr') from what seemed to be another place it was being set by default. I'd just like it to be correct. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DiegoPino you're thinking something like this?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was there any more work for me to do for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry. This gone slipped under my radar (radar is off-line, forgot to pay the bill) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This just needs the second 'false' to be removed, right? for newspaper and ocr? @whikloj that was your comment right? |
||
variable_set('islandora_newspaper_ingest_derivatives', $newspaper); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is ocr being defaulted to FALSE and then set to FALSE again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, checked code and I know why! but, as my
#95 (comment) says this should be defaulted to
array('ocr')
to make sure code is more portable.