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

Issue 1491: Add default values for name (and alt text for images) in add media form #777

Closed
wants to merge 3 commits into from

Conversation

mjordan
Copy link

@mjordan mjordan commented May 27, 2020

Note: Do not merge. This PR has been replaced by #783 (same code changes, but I deleted the source repo since opening this PR).

Github Issue: Islandora/documentation#1491

What does this Pull Request do?

Provides default values for the media name field, and for Image media, a default value for the Alt text field.

What's new?

Implementation of hook_form_alter() to populate the media name field, and an implementation of hook_page_attachments() + the addition of a Javascript file to populate the image Alt text field.

How should this be tested?

  1. Check out this branch.
  2. Clear your cache (e.g. drush cr)
  3. Create a new Islandora object with the model "image" and add an image media. The image Name and Alt text fields should be automatically populated with the parent node's title.
  4. Create a new Islandora object with a model different than "image" and add a media. The media's Name field should be automatically populated with the parent node's title.

Additional Notes:

  • Does this change the interface, add a new feature, or otherwise change behaviours that would require updating documentation? Yes, improves the UX by providing sensible default values in form fields.
  • Does this change add any new dependencies? No.
  • Does this change require any other modifications to be made to the repository (ie. Regeneration activity, etc.)? No
  • Could this change impact execution of existing code? Yes.

Interested parties

@Islandora/8-x-committers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants