Implement UUID hooks so redirects can be deployed through deploy module.

This should be a separate module, since it alters the schema for adding the uuid field to redirect table.

Comments

recidive’s picture

Status: Active » Needs review
StatusFileSize
new3 KB

Attached patch introduces a media_uuid module for adding uuid field to redirect table and handling the conversion of rid to uuid and vice versa.

recidive’s picture

StatusFileSize
new3 KB

Fixing a typos in key names.

skwashd’s picture

Status: Needs review » Needs work

Overall this looks good and works well. One nitpick below.

+++ b/redirect_uuid/redirect_uuid.infoundefined
@@ -0,0 +1,6 @@
+description = Allow deploying redirects through Deploy and UUID modules. ¶

Trailing whitespace

skwashd’s picture

Assigned: recidive » skwashd
Status: Needs work » Needs review
StatusFileSize
new5.39 KB

The attached version of the patch deals with quite a few issues with @recidive's patch.

skwashd’s picture

StatusFileSize
new3.71 KB

Rerolled without the swap file in the patch.

jamesharv’s picture

StatusFileSize
new3.75 KB

In the patch from #5, redirect_uuid_entity_uuid_load() and redirect_uuid_entity_uuid_presave() are universalising the source property of the redirect, rather than the redirect property. I think this is incorrect. I've attached an updated patch with this correction.

jamesharv’s picture

StatusFileSize
new4.19 KB

After running this patch for a bit I've realised that both the source and redirect values need to be universalised because it is quite possible to have a redirect where either the source or redirect are node urls (or both even). Here's a patch which universalises both.

jamesharv’s picture

StatusFileSize
new4.64 KB

Another bug I've picked up with this is that the uuid of each redirect gets regenerated when you edit it. That's because the edit form doesn't post the uuid as a value, and only the form values are passed to redirect_save() in redirect_edit_form_submit().

Updated patch is attached with the hook_form_alter() implementation to add the uuid to the form's values.

jamesharv’s picture

StatusFileSize
new4.61 KB

This is a slightly better version which uses hook_form_FORM_ID_alter().

indytechcook’s picture

Status: Needs review » Reviewed & tested by the community

Patch in number 9 works great

pere orga’s picture

Assigned: skwashd » Unassigned
Issue summary: View changes
dave reid’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/redirect_uuid/redirect_uuid.module
@@ -0,0 +1,76 @@
+  $entity_info['redirect']['creation callback'] = 'entity_metadata_create_object';
+  $entity_info['redirect']['save callback'] = 'redirect_save';
+  $entity_info['redirect']['deletion callback'] = 'redirect_delete';
+}

These seem like things worthwhile to put back in redirect.module since these are not specific to UUID integration.

skwashd’s picture

Status: Needs work » Needs review
StatusFileSize
new4.84 KB
new2.43 KB

Rerolled with the change requested in #12.

skwashd’s picture

Status: Needs review » Closed (won't fix)

After 3 years of waiting I have created the UUID Extras project and committed a modified version of this patch there. Closing as WONTFIX.

dave reid’s picture

With no one to help peer review for over 9 months, I'm not sure what I should do. I don't use UUID or Deploy normally. If we're happy having it in a separate module, that seems best.