nextcloud / tables

🍱 Nextcloud tables app
https://apps.nextcloud.com/apps/tables
GNU Affero General Public License v3.0
149 stars 23 forks source link

Link to image does not show preview anymore #1375

Open MI-KY opened 2 months ago

MI-KY commented 2 months ago

Steps to reproduce

Some time ago (unfortunately I can't say if this has to do with a specific version of tables) when I created a link to a image saved inside Nextcloud the table did not only show the link to the file but also a preview image (very little image). Now, when you create a column with type "link" the table does not show any previews anymore.

The preview of the image does exist - this is also visible while you compile the fields: grafik

But inside the table itself there is no preview - but there was one some versions ago: grafik

Expected behavior

See a preview image of a link to a image

Actual behavior

Only linktext is shown

Tables app version

v0.8.0

Browser

Firefox 130.0.1

Client operating system

Ubuntu

Operating system

Ubuntu

Web server

Apache

PHP engine version

None

Database

None

Additional info

No response

cm-schl commented 2 months ago

I've looked into the code a bit. Could the problem maybe arise because of https://github.com/nextcloud/tables/blob/189050cf03fc2d4d6fe4c8824cbd6c656fc0042b/src/shared/components/ncTable/partials/rowTypePartials/TextLinkForm.vue#L216 checking the url of item.thumbnailUrl? In fact when I directly call the ocs api the result for a request like <DOMAIN>/ocs/v1.php/search/providers/files/search?term=<Imagename> looks like this:

   <element>
    <thumbnailUrl><DOMAIN>/index.php/core/preview?x=32&amp;y=32&amp;fileId=123456</thumbnailUrl>
    <title>Imagename.jpg</title>
    <subline>path</subline>
    <resourceUrl><DOMAIN>/index.php/f/123456</resourceUrl>
    <icon>/index.php/apps/theming/img/core/filetypes/image.svg?v=af2ffedd</icon>
    <rounded></rounded>
    <attributes>
     <fileId>123456</fileId>
     <path>/path/Imagename.jpg</path>
    </attributes>
   </element>

With &amp; in the url instead of &. Getting the url with &amp; in it returns an empty response - the url with & returns the preview. So maybe the check for the url by isUrlReachable now always deletes the thumbnail?