-
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
adding configurable handling of image metadata to migraterelations #74
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit consists of the following changes: - setting actual image captions (new field is "description", not "title") - migrating actual title text - migrating alt text - using title as description in media (still have to check if that's really correct, but seems so) - still needs investigation as to what to set for media Unfortunately, the correct way of migration those settings varies from installation to installation as it depends on FE rendering setup. Especially, it depends on whether dam_ttcontent had been added to static includes before (default with DAM if used: set title & alt texts in any case from DAM, only override by tt_content if set; default if not used: only printing what's directly in tt_content). Any way, user may have overridden rendering to something else in tt_content.image.20.1 so we need some configuration options to allow user to set the correct action (may still be a problem on huge installations with multiple templates having been set up differently). So this is not the ultimate solution yet...
…should go into description field instead
$useIndividualTitles and $useIndividualAltTexts can now be used to remove default texts previously copied as default from file metadata to content element relation (removing file-based titles & alt texts if not defined in content element, as would be the default behaviour if, with DAM, static include dam_ttcontent would have been missing). Still, we may want an option to disable default copy from file metadata all together to allow central texts changes as we had with DAM, so there will be at least one more patch before this is done...
Git history looks like processing "image" fields on pages and language overlays has accidentally been introduced. Furthermore, "media" migration on pages/language overlays appears to query tt_content with a page ID accidentally used for a content element UID. This was supposed to perform migration for dam_pages extension but (just from reading) doesn't appear to make any sense. Added a comment and left it enabled so far, will open a bug report together with this pull request.
As previous attempts at correctly migrating caption, title and alt texts revealed that migration cannot be done in one or two uniform ways but requires individual configuration depending on TS setup of a website we are now introducing "chains". Please refer to command reference and MigrateRelationsChainOptions.rst for details on how this works.
# Conflicts: # Classes/Controller/DamMigrationCommandController.php # Classes/Service/MigrateRelationsService.php # Documentation/CommandReference/Index.rst # Documentation/UserManual/Index.rst
Tuurlijk
pushed a commit
that referenced
this pull request
Sep 2, 2015
adding configurable handling of image metadata to migraterelations
@@ -259,6 +324,7 @@ protected function execSelectDamReferencesWhereSysFileExists() { | |||
sys_file_metadata.title, | |||
sys_file_metadata.description, | |||
sys_file_metadata.alternative, | |||
sys_file_metadata.caption, |
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.
This breaks a lot migrations as the caption field is added by EXT:filemetadata which is deactivated by default and a SQL error is thrown now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As it turned out, image metadata (captions, titles, alt texts) are not handled uniformly across different TYPO3 installations. Please see Documentation/MigrateRelationsChainOptions.rst from our branch for details.
We are therefore introducing configurable "chains" of fields, enabling users to specify the order of applying image text fields from content elements or DAM and how they should be handled afterwards (overriding with an empty string so later changes don't take effect or using the default behaviour of falling back to central FAL metadata fields by not setting "override" option = setting NULL on database).