Removing asset breaks page edit

I deleted an asset from the assets part of the Admin section. The asset was in use on a page on one of my sites. I can’t access the page to edit it - I get the following error:

Omeka\Api\Exception\NotFoundException**
Omeka\Entity\Asset entity with criteria {“id”:“72”} not found

Is there a way to override the error (I have access to the phpmyadmin for this server, so I can edit the database if that’s necessary)

1 Like

We’ll get this fixed so it’s not an error going forward.

As far as an immediate workaround: you could delete the block that you’re using the asset on as one relatively simple option.

I’ve seen this post only after encountering a similar error, and writing up a description of the bug. The issue here is related, but not quite the same to the one I found, which appears after deleting a page linked from an asset (see below for details).

At least in the case I outline, the immediate workaround, unfortunately, does not really work, as it is not possible to edit the page with the asset (editing the page also throws an error).

This obviously is causing troubles in particular to those who use “assets” to encourage navigation across different sections of an exhibition.

I understand you have probably already identified the error, but just in case, I leave below the “steps to reproduce” I prepared before finding this post, also because my case is not really the same as the one described by @maybee


Steps to reproduce:

  • Create a page, “Page A”

  • Create a page, “Page B”

  • In “Page A”, add a block of type “asset”, add any image, and then as “Page link” select “Page B”

  • Delete “Page B”

  • Try to view “Page A” (or edit “Page A”)

What happens: “Omeka S encountered an error”

Expected behaviour: See the same page, but the link in the asset simply does not work

How to prevent: remember to remove links from assets, before deleting a page

Workaround, after it happens: it’s a bit of a pain really, since it is now not possible to edit “Page A” to remove the relevant asset block, or change the link. In principle, you can delete “Page A” and recreate it anew, but, if you, for example, had a “Page C” that linked to “Page A”, then “Page C” would now also be broken. So you go ahead and delete “Page C”, and… on it goes. (or perhaps there’s an easier way via API)

We have a fix written already based on the previous post; the fix deals with both missing assets and missing pages.

We just have to make it ready for release.

The suggestion to delete the block was in the context of the original poster mentioning they could edit the database directly.

2 Likes

Looks great, thanks!

I made the changes to asset.php shown in your fix and I was once again able to edit the page that was using an asset that was mistakenly deleted. [ Omeka 3.1.1]

Omeka S 3.1.2 includes the fix for this problem.

1 Like

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.