U4-9250 - Guid all the Macros

Created by Stephan 06 Dec 2016, 17:02:38 Updated by Shannon Deminick 29 May 2017, 18:15:55

Is required for: deploy-120

Subtask of: deploy-118

Macros in 7.5 do not have a Guid, this needs to change + service should GetById(guid) etc.

Comments

Stephan 20 Dec 2016, 13:10:00

PR (against 7.6): https://github.com/umbraco/Umbraco-CMS/pull/1657

Review: upgrade to 7.6 or install, check that tables cmsMacro and cmsMacroProperty both have a new uniqueId column. Create a macro, with parameters: they should have GUIDs in these columns. Editing the macro, changing the alias, etc should preserve the GUIDs (they should not change).


Stephan 20 Dec 2016, 13:47:59

Almost there, but a alter-table migration is not running properly ;-(


Stephan 20 Dec 2016, 14:25:47

fixed, ready for review


Stephan 20 Dec 2016, 18:27:18

or maybe not, fixing...


Stephan 21 Dec 2016, 14:01:11

should be good this time - further testing: should be possible to edit and save a macro, add and remove parameters, change aliases, and even swap the alias of two parameters.


Shannon Deminick 22 Dec 2016, 04:40:50

All seems to work, have added some comments on GitHub and pushed another rev to have the macro service test the GUID/Keys. Might be worth adding tests for the new methods added: IMacro Get(Guid id), IEnumerable<IMacro> GetAll(params Guid[] ids), bool Exists(Guid id)

I've also added a commit to test which version of Umbraco is running based on the db schema, I've tested running 7.6, then removing these new columns and clearing out the version in the web.config which forces the installer to run again and with this new change it detects 7.5 and re-adds the colums. I've also tested clearing out the version in the web.config and re-running the installer with the columsn already there and there are no errors.

I'll put this into re-work for you to review my changes and make any of these suggested updates


Stephan 22 Dec 2016, 10:26:25

Your changes look ok + have cleaned up according to suggestions and added tests.


Priority: Normal

Type: Feature (request)

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.6.0

Sprint: Sprint 49

Story Points: 2.5

Cycle: