Ticket #701 (closed Bug report: fixed)

Opened 8 years ago

Last modified 8 years ago

Delete content from gui, does not delete

Reported by: dorin.vlas@… Owned by:
Priority: high Milestone: WifiDog Auth Server 2.0
Component: Auth server, Content Management Version: Auth Server SVN
Keywords: Cc:

Description

I have added, then succesefuly deleted some Trivial, after that I get this error when truing to edit network.

I think the Trivial object is deleted but the link in db NO... and that causes this error.

I have all the dependencies OK and the wifidog user has an public_html linked to wifidog-svn directory

Detailed error was: Uncaught Exception The content with the following id could not be found in the database: 341c50ede3d1dca3e1949bb43b0a23cc (0) thrown in file /home/wifidog/wifidog-svn/wifidog/classes/Content.php, line 275 #0 /home/wifidog/wifidog-svn/wifidog/classes/Content.php(722): Content::getObject('341c50ede3d1dca...') #1 /home/wifidog/wifidog-svn/wifidog/classes/HotspotGraphElement.php(369): Content::getLinkedContentUI('hge_afde8534e62...', 'hotspot_graph_e...', 'hotspot_graph_e...', 'afde8534e62c445...', 'portal') #2 /home/wifidog/wifidog-svn/wifidog/classes/Network.php(1698): HotspotGraphElement?->getContentAdminUI() #3 /home/wifidog/wifidog-svn/wifidog/admin/generic_object_admin.php(396): Network->getAdminUI() #4 {main}

Change History

Changed 8 years ago by benoitg

Geneviève, there is a missing integrity constraint in the hotspot_graph_has_content table on content id, making this possible.

Changed 8 years ago by gbastien

  • status changed from new to closed
  • resolution set to fixed

Yes indeed, I forgot an integrity constraint. It has been fixed in [1451].

But how did this situation happen? I couldn't reproduce it even without the constraint.

Anyway, it shouldn't happen again, but for this case, you'll have to go in the database and manually remove the lines referring to the deleted content in the hotspot_graph_element_has_content table.

Changed 8 years ago by benoitg

When doing such refactoring, always put the fix inside the schema update, otherwise, the schema update chain will break for anyone who has violating rows, and it's unlikely most people will know how to fix it without breaking anything.

I updated schema update 69. Sinche it's withing a transaction, it will replay for anyone for who it failed.

Note: See TracTickets for help on using tickets.