Migrate all custom fields declared by pmtask to field_api based fields. Also declare a field that other could use to reference pmtask.

Fields to be migrated are:

Status: DRAFT (not yet agreed upon field types and name.)

  1. currency to pmtask_currency (select list)
  2. pricemode to pmtask_pricemode (select list)
  3. price to pmtask_price (text field)
  4. durationunit to pmtask_durationunit (select list)
  5. duration to pmtask_duration (text field)
  6. body to body (migration code pending)
  7. datebegin/dateend to pmtask_date (date)
  8. organization_nid/title to pmorganization_ref (entityreference)
  9. project_nid/title to pmproject_ref (entityreference)
  10. parent_nid to pmtask_parent_ref (entityreference)
  11. assigned_nid/title to pmperson_assigned_ref (entityreference)
  12. billable to pmtask_billable (check box)
  13. billed to pmtask_billed (check box)

Fields needed to be declared by pmproject but not used.

  1. pmtask_ref
  2. pmtask_parent_ref

Points to be discussed:

  1. Use of date field.
  2. Merging billable & billed to single field (select list).

====================
CHECKLIST

1) Migrate schema to field api
☐ 1.a) Corresponding field_base definition created for all fields.
☐ 1.b) Corresponding field_instance definition created for all fields.
☐ 1.c) field_base and field_instance created on install
☐ 1.d) field_base and field_instance created on update
☐ 1.e) All field_base defnition agreed upon
☐ 1.f) All field_instance defnition agreed upon

2) Migrate Data
☐ 2.a) All data migrates properly

3) Permission
☐ 3.a) Remove entries in hook_permissions, hook_node_access_records and hook_node_grants
☐ 3.b) Set site variables in install & update routines to handle permissions by pmpermission module
☐ 3.c) Migrate old permission names to new one
☐ 3.d) Rebuild permission message shown to user

4) Views
☐ 4.a) Main listing view adjusted
☐ 4.b) Remove obsolete handlers
☐ 4.c) Document the missing Handlers

5) Token
☐ 5.a) Migrate Tokens
☐ 5.b) Remove obsolete/unsupported tokens
☐ 5.c) Document the missing Tokens

6) Theme
☐ 6.a) Remove unused theme functions and files.

7) Node
☐ 7.a) Remove obsolete codes to handle database updates for CRUD operations
☐ 7.b) Remove custom theme function for rendering the nodes
☐ 7.c) Adjust breadcrumb criterion in hook_node_view to effect node edit/full page view mode.
☐ 7.d)

NOTE: Mark it (copy paste) as done with these symbol -
☐ TODO
☑ DONE
☒ IGNORE

References:
#1915320-30: Move to a Field API based approach
#1997488-10: Tips for Migrating from Storm to PM

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Raphael Dürst’s picture

Status: Active » Needs review
FileSize
1.07 KB

And here's a patch for pmtask_ref.

Status: Needs review » Needs work

The last submitted patch, 2044023-pmtask_ref.patch, failed testing.

dbt102’s picture

Patch installed cleanly. Update completed OK.

Checked out the database.

In the table field_config I can see the entry with the field_name pmtask_ref and I can see the tables field_data_pmtask_ref and field_revision_pmtask_ref.

D34dMan’s picture

I think i know why the test are failing. The doesn't have the new dependency 'entityreference' that is declared in them which have been introduced due field_api patch.

D34dMan’s picture

Assigned: Unassigned » D34dMan
Issue summary: View changes

feature/pmpeson branch handles PM Task migration now. Please test.

juliangb’s picture

Adding link to parent issue.

juliangb’s picture

Status: Needs work » Needs review

I've just refreshed my test site from the latest in the feature/pmperson branch in git.

One comment so far - the view doesn't work as it expects a table called pmtask.

Working otherwise.

juliangb’s picture

Question - in the pmtask code the update_last_removed is updated to note that we've removed updates.

However. I believe this could lead to warnings if users are updating from previous versions of PM before they ran these.

Do we need to force users to follow all updates in turn, or could the user go straight from (example) alpha1 to feature/pmperson?

D34dMan’s picture

Question - in the pmtask code the update_last_removed is updated to note that we've removed updates.

Correct.

However. I believe this could lead to warnings if users are updating from previous versions of PM before they ran these.

It should not cause,
1.) I have created field_base and field instance definition of the one that was use by pm.
2.) In the migration code, should migrate respective field only if the respective columns in the table have non empty values. This way it should automatically populate the fields of the node if they are not empty ( maybe we could use isset here ?)

Do we need to force users to follow all updates in turn, or could the user go straight from (example) alpha1 to feature/pmperson?

My idea is that the user should be able to update from any version. I feel its possible through current method. Let me know if there are any design flows, we could work upon that.

juliangb’s picture

Makes sense.

I think there is a use case where this falls down, but I will test first to ensure I've fully understood how those core functions work.

D34dMan’s picture

The field base and field instances are created only if they are not present already. Further the fields those where present earlier where such that the empty values where illegal values. For example the date value couldn't be a zero as well as the list values. The issues which has not been addressed in migration are the tokens and migration of permission configuration.

juliangb’s picture

FileSize
15.76 KB

I've just been testing this.

I tried checking out 7.x-1.0-alpha1 then upgrading directly to the feature/pmperson HEAD. Whilst the migration script accepts this, the Drupal core refuses to apply updates because it says that updates have been missed.

It is a simple change that is required, and relates to the update_last_removed hook. I'm going to do it now.

D34dMan’s picture

I am sorry i couldn't understand the issue.

Glad that you have a fix with you.

juliangb’s picture

Status: Needs review » Needs work

I'm now moving on to testing in the hope that we can agree that parts of the changes in feature/pmperson are done, until eventually we agree that the merge can take place. I propose to use the status of each individual ticket to track that part.

#todo Default view needs fixing.

D34dMan’s picture

Issue summary: View changes
juliangb’s picture

Here's my review of PM Task. Let me know if you want me to clarify and of the pendings.

Status of - pmtask
☐ 1) Migrate schema to field api
☒ 1.a) Corresponding field_base definition created for all fields.
☒ 1.b) Corresponding field_instance definition created for all fields.
☑ 1.c) field_base and field_instance created on install
☑ 1.d) field_base and field_instance created on update
☒ 1.e) All field_base definition agreed upon
☒ 1.f) All field_instance definition agreed upon

☐ 2) Migrate Data
☒ 2.a) All data migrates properly

☐ 3) Permission
☑ 3.a) Remove entries in hook_permissions, hook_node_access_records and hook_node_grants
☒ 3.b) Set site variables in install & update routines to handle permissions by pmpermission module
☒ 3.c) Migrate old permission names to new one
☒ 3.d) Rebuild permission message shown to user

☐ 4) Views
☒ 4.a) Main listing view adjusted (fields and access permission)
☑ 4.b) Remove obsolete handlers
☒ 4.c) Document the missing Handlers

☐ 5) Token
☒ 5.a) Migrate Tokens
☒ 5.b) Remove obsolete/unsupported tokens
☒ 5.c) Document the missing Tokens

☑ 6) Theme
☑ 6.a) Remove unused theme functions and files.
☑ 6.b) Remove hook_theme declaration if required

☑ 7) Node
☑ 7.a) Remove obsolete codes to handle database updates for CRUD operations
☑ 7.b) Remove custom theme function for rendering the nodes
☒ 7.c) Adjust breadcrumb criterion in hook_view to effect node edit/full page view mode.

☐ 8) Other
☐ 8.a) Solve and remove any TODO flags

  • D34dMan committed b2940b8 on 7.x-2.x
    Issue #2044023 by Raphael Dürst - PMTask: Migrate to field_api based...
  • D34dMan committed d7e1a09 on 7.x-2.x
    Issue #2044023 by Raphael Dürst - PMTask: Migrate to field_api based...

  • D34dMan committed 06b13f8 on 7.x-2.x
    Issue #2044023 by D34dMan, juliangb: pmtask - Migrate old permission...
juliangb’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.