Updated description:

Upgrade step is not needed and instead of removing the record, set it to
'null' because we need to keep 'If the associated template is deleted,
the text “Page deleted” is displayed. ' from the original wishlist item
bug #1857936

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask 
on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1915352

Title:
  Problem with view_instructions_lock when deleting a page

Status in Mahara:
  Confirmed
Status in Mahara 20.10 series:
  Confirmed
Status in Mahara 21.04 series:
  Confirmed

Bug description:
  When we delete a page we remove the view_instructions_lock row for the
  copied views if there is a match but not for the originaltemplate if
  there is a match

  When we delete a view we need to do both
          delete_records('view_instructions_lock', 'view', $this->id);
  and
          delete_records('view_instructions_lock', 'originaltemplate', 
$this->id);

  We also need to have an upgrade step to fix sites where they upgraded so that 
the 
      "viewinstlock_ori_fk" FOREIGN KEY (originaltemplate) REFERENCES view(id)

  exists on the view_instructions_lock table

  This relates to a mistake in
  https://reviews.mahara.org/#/c/10825/

  To test:

  1 Make a new site (note it has to be new and not upgraded)
  2 Make a new user
  3 Make an institution
  4 Make an institution page for this institution and set Advanced -> Template 
to 'yes'
  5 Go to share for the page and under Advanced options ->  Copy for new 
institution members to 'yes'
  6 Add a user to institution
  7 Delete the original institution page

  You should get the following error
  ERROR:  update or delete on table "view" violates foreign key constraint 
"viewinstlock_ori_fk" on table "view_instructions_lock"

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1915352/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to