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

added ability to edit associations #230

Merged
merged 14 commits into from Sep 17, 2017
Merged

added ability to edit associations #230

merged 14 commits into from Sep 17, 2017

Conversation

ajstanley
Copy link
Contributor

JIRA Ticket: (https://jira.duraspace.org/browse/ISLANDORA-1765)

What does this Pull Request do?

Adds the ability to alter existing form associations

What's new?

Added a link under operations to move to a form allowing changes to be made.

How should this be tested?

Navigate to existing editable for association,
There will be an Edit button next to the Delete button
Clicking Edit will take you to an edit form.
Change one or more values in this association.
Save, and check to see that changes persisited

Interested parties

Tag (@Islandora/7-x-1-x-committers)

* The drupal form state.
* @param string $form_name
* The name of an XML form.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param for $id is missing here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has been fixed.

*
* @return DOMDocument
* Transformed document on success, original on failure.
*/
function xml_form_builder_transform_metadata_datastream(DOMDocument $source_document, $transform = NULL) {
function xml_form_builder_transform_metadata_datastream(DOMDocument $source_document, xslt $transform = NULL) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if xslt really a data type/class? Not sure about that. Where is that defined so? Seems to me that array_key_exists($transform, $transforms) denotes that $transform is just an array key value, so type hinting there should be wrong and also annotation @params for $transform?

@manez
Copy link
Member

manez commented Aug 22, 2016

I tested this from the front end and it looks good. @jordandukart @DiegoPino are you satisfied with your code review?

@DiegoPino
Copy link
Contributor

DiegoPino commented Sep 1, 2016

Hey @jordandukart 😄 checking on this pull, do you feel @ajstanley solved your concerns or still something missing? Thanks a lot!

}
}
$options = xml_form_builder_get_title_options($form_name);
$search = "['" . implode("']['", $association['title_field']) . "']";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no title_field set it's stored as FALSE and this implode will break.

@DiegoPino
Copy link
Contributor

@jordandukart @ajstanley hi. Anything missing here? Are you all ok on the changes or issues pending?

@ajstanley
Copy link
Contributor Author

Its all good AFAIK, Diego

@DiegoPino
Copy link
Contributor

@jordandukart will ping you again about the issues you found originally. Are they addressed? @ajstanley says its all good /thanks for the patience on this, and I really feel this is a good candidate for our incoming release. Thanks!

@DiegoPino
Copy link
Contributor

@jordandukart ping. Just need to be sure Concerns are addressed, don't want to make @ajstanley wait (more) but if there are pending things here lets discuss then. Thanks! 😄

@jordandukart
Copy link
Member

Will try go get this today.

@jordandukart
Copy link
Member

Our PHPCS is behind a bit (think this is on the radar to update but):

FILE: islandora_xml_forms/builder/includes/associations.form.inc
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 150 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
     |       |     found 4
 151 | ERROR | [x] Line indented incorrectly; expected 6 spaces,
     |       |     found 4
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

$id = $form_state['values']['id'];
$form_name = $form_state['values']['form_name'];
$template = '';
$file_uploaded = isset($form_state['values']['template_file']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pops warnings as the file is managed the value is a fid. So when the fid isn't 0 it'll have been uploaded.

    Notice: Trying to get property of non-object in xml_form_builder_edit_association_form_submit() (line 426 of /var/www/drupal7/sites/all/modules/islandora_xml_forms/builder/includes/associations.form.inc).
    Warning: DOMDocument::load(): Empty string supplied as input in load() (line 426 of /var/www/drupal7/sites/all/modules/islandora_xml_forms/builder/includes/associations.form.inc).

Could just do if ($form_state['values']['template_file'] && !$form_state['values']['remove_transform']) and remove the $file_uploaded var.

@jordandukart
Copy link
Member

Not a blocking problem but a general comment that the auto-formatting of things that weren't directly changed makes reading these diffs a pain.

@ajstanley
Copy link
Contributor Author

I had some inconsistent warnings with coder spacings, but it should all be good now - Apologies about the auto-formatting.

@DiegoPino
Copy link
Contributor

@ajstanley sorry for making you wait so long. Will test tonight and merge tomorrow. Thanks

Copy link
Member

@rosiel rosiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works! @DiegoPino ok to merge?

@DiegoPino
Copy link
Contributor

@rosiel I tested this long time ago and forgot probably. Can't be sure. If you want to merge and you tested, deeply go for it.

@rosiel rosiel merged commit 454df21 into Islandora:7.x Sep 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants