[PLUGINS][Embed] Embed references a table that does not exist. It seems to mean attachment_embed, rather than link_to_attachment

This commit is contained in:
Hugo Sales 2021-09-05 20:42:40 +01:00
parent cd89106fc0
commit bdde047dfa
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -304,9 +304,9 @@ class Embed extends Plugin
} }
// If an attachment already exist, do not create an Embed for it. Some other plugin must have done things // If an attachment already exist, do not create an Embed for it. Some other plugin must have done things
$link_to_attachment = DB::find('link_to_attachment', ['link_id' => $link->getId()]); $attachment_to_link = DB::find('attachment_to_link', ['link_id' => $link->getId()]);
if (!is_null($link_to_attachment)) { if (!is_null($attachment_to_link)) {
$attachment_id = $link_to_attachment->getAttachmentId(); $attachment_id = $attachment_to_link->getAttachmentId();
try { try {
$attachment = DB::findOneBy('attachment', ['id' => $attachment_id]); $attachment = DB::findOneBy('attachment', ['id' => $attachment_id]);
$attachment->livesIncrementAndGet(); $attachment->livesIncrementAndGet();