← Back to team overview

mahara-contributors team mailing list archive

[Bug 1281787] [NEW] Artefacts not locked in in submitted view

 

Public bug reported:

This looks to be problem with data on older sites. I've marked as high
as bad data should be sorted asap

Looking in the database there are views submitted for review but
artefacts used in the view are not locked.

To find the rows:
SELECT a.id     
FROM view_artefact va 
LEFT JOIN view v on v.id = va.view
LEFT JOIN artefact a on a.id = va.artefact
WHERE v.submittedgroup IS NOT NULL AND a.locked = 0

And to fix them:
UPDATE artefact SET locked = 1
FROM (SELECT a.id     
FROM view_artefact va 
LEFT JOIN view v on v.id = va.view
LEFT JOIN artefact a on a.id = va.artefact
WHERE v.submittedgroup IS NOT NULL AND a.locked = 0) AS subquery
WHERE artefact.id = subquery.id;

More investigation into how the databases ended up with bad data is
needed and then a db upgrade change will need to be added to
/lib/db/upgrade.php if needed.

** Affects: mahara
     Importance: High
     Assignee: Robert Lyon (robertl-9)
         Status: Confirmed

-- 
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/1281787

Title:
  Artefacts not locked in in submitted view

Status in Mahara ePortfolio:
  Confirmed

Bug description:
  This looks to be problem with data on older sites. I've marked as high
  as bad data should be sorted asap

  Looking in the database there are views submitted for review but
  artefacts used in the view are not locked.

  To find the rows:
  SELECT a.id     
  FROM view_artefact va 
  LEFT JOIN view v on v.id = va.view
  LEFT JOIN artefact a on a.id = va.artefact
  WHERE v.submittedgroup IS NOT NULL AND a.locked = 0

  And to fix them:
  UPDATE artefact SET locked = 1
  FROM (SELECT a.id     
  FROM view_artefact va 
  LEFT JOIN view v on v.id = va.view
  LEFT JOIN artefact a on a.id = va.artefact
  WHERE v.submittedgroup IS NOT NULL AND a.locked = 0) AS subquery
  WHERE artefact.id = subquery.id;

  More investigation into how the databases ended up with bad data is
  needed and then a db upgrade change will need to be added to
  /lib/db/upgrade.php if needed.

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


Follow ups

References