Images in list not visible anymore

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Dadinos2
User
Posts: 52

Images in list not visible anymore

Post by Dadinos2 »

After upgrading an old project to the v2024 (from v2023) my images are not showing in the list views.

If I look in the Demo cars list I see this links for the pictures:

 <a target="_blank" title="Click to view image" data-rel="cars_x1_Picture" class="ew-lightbox cboxElement" 
 href="/api/file/cars/Picture/1?session=/..." class="ew-image ew-lazy" style="width: 200px">
</a>

In my PHPmaker 2024 applicatiomn it is:

<a title="Click to view image" data-rel="articles_x1_image" class="ew-lightbox cboxElement" 
 href="/api/file/articles/eyJpdiI6Im52WDZSZTRuNUR" class="ew-image ew-lazy" style="height: 45px">
</a>

But the real pictures are stored in uploads/articles and for every row I get this warning:

       GET 
http://mysite.nl/api/file/articles/eyJpdiI6IkNRSnd4djYvTEJ2TnphYUVBYmFEZXc9PSIsInZhbHVlIjoiMVVkWXJUWm1uR
U1YaFBlQ2kzcUw0dnRq....g4MzZhN2M4NDg2NmE0ZjNiIiwidGFnIjoiIn0=?
width=0&height=45&session=eyJpdiI6Im9iUDQ0STZo....iwidGFnIjoiIn0=&
csrf_name=csrf65ca26649d79e&csrf_value=amgFDFf280DkvD8+Tx26znk1+L5LtnND31uH2cRx234PW2c4Y8GXI9CF
D1ouftmvSwaa23uPEiG8Ob689EPoTA== 400 (Bad Request)

So what can I do to show the article images again ?

Regards,

Aren


arbei
User
Posts: 9384

Post by arbei »

  1. If you enable Encrypt file path, the path is encrypted.
  2. You may enable Debug to check the detailed error message in the log file.
  3. If you enable Use route cache: When you deploy new versions of your scripts (for example, after adding or deleting a table) to production, you must delete the generated file (<ProjectFolder>/<LogFolder>/cache/RouteCache.php) to ensure that the cache will be re-compiled.

Dadinos2
User
Posts: 52

Post by Dadinos2 »

Ok I switched of the encrypted path.

<td data-name="image">
	<span id="el3_articles_image" class="el_articles_image">
		<span>
			<a title="Click to view image" data-rel="articles_x3_image" class="ew-lightbox cboxElement" href="/upload/articles/S24611-Georgie-Blazer-Short_01.jpg?session=eyJpdiI6IlJwL0RMdDB....qIf0Q==">
				<img loading="lazy" alt="" src="/api/file/articles/eyJpdiI6ImFGVXMrakJESzlmdTJoajhhUytDZ2c9PSIsInZhbHVlIjoiUHVxYzdhMzRjOVlKWEg2Nis3YUJCNkpMR0pDVStQYllobjZkeTV3cnRS...x1M9C3ICS9tqIf0Q==" class="ew-image ew-lazy" style="height: 45px">
			</a>
		</span>
	</span>
</td>

So the link path gives me the correct path to the image. (/upload/articles/S24611-Georgie-Blazer-Short_01.jpg)
But will not showup after the click
The img path looks like a call to the api with the JWT token in it but where is the image / id ? (/api/file/articles/eyJpdiI6IksvMkljY0dmY1dzUH)

I keep having the same error in the console.

       GET http://fashion.nl/api/file/articles/eyJpdiI6IksvMkljY0dmY1dzUHNjT2s2TFQ1TEE9PSIsInZhbHVlIjoib0JsUHN5d1RyaXBLMGl1c2Flb2JGSXhNNEpidjV3SG54YlV2TVRObHVyMkdnVjFCbzVCNTFmWENNbDdnS3U5V2FkaWRITS9zb1pEbDNhOXkwMk51RUlZK0NGblFGQkswajBTUU9qRFEzZWl4b2srMk5KTFlGMmU0TGpPNnpDOHIiLCJtYWMiOiIwZTE3MWE3MTI4ZThmZWM0ZTg3MzRhMDM1ZjhkNmRlNmVlZGNiOTY2ODFiNjdkOGVmOTZhNTA0MjU1MDhkNWRlIiwidGFnIjoiIn0=?width=0&height=45&session=eyJpdiI6Ik9GN3NEbHdGS0ZmQXE0enh6RlNPNEE9PSIsInZhbHVlIjoiK0taekJqYm9CVzN4eWhDN1hkc2NDQmlwenhCeURZZWUzeGg1ZWR1UlBlYz0iLCJtYWMiOiJlNTUxNjU1OTY5NDEzYjFhZTg4ZTFkNjc2Y2IxMTI3Mzc4ZjI0ZTg4NDM1NmVlM2I0MWIyODY2NDc2N2JmNGFiIiwidGFnIjoiIn0=&csrf_name=csrf65cb22b28e265&csrf_value=/ZH+UDipF7qU1mwnWVvZI9Rzbzgy2GKApqywl5P9QwSZ9J9kXpx23qy0VBJtb7hFsktdCAbtALfDyIf2qskhMA== 400 (Bad Request)

arbei
User
Posts: 9384

Post by arbei »

arbei wrote:

You may enable Debug to check the detailed error message in the log file.


Dadinos2
User
Posts: 52

Post by Dadinos2 »

I removed the cache and switched on debug.
No errors at all. PHP E_ALL is set.

Strang thing is that one table it working!

My Brands table shows the images correctly

<span>
	<a title="Click to view image" 
		data-rel="brands_x3_image" 
		class="ew-lightbox cboxElement" 
		href="/upload/brand/regentgarden-100.jpg?session=eyJpdiI6I....U/W0EsIyUFALOVg==">  <!-- correct href //-->
	
	 <img loading="lazy" alt="" src="/upload/brand/regentgarden-100.jpg?session=eyJpdiI6Ikh....0EsIyUFALOVg=="    <!-- correct href also //-->
		 class="ew-image  ew-lazy" 
		 style="width: 100px">
	</a>
</span>

My article and accounts table does not

<span>
	<a title="Click to view image" data-rel="articles_x5_image" 
		class="ew-lightbox cboxElement" 
		ref="/upload/articles/S24628-Giselle-Pants_2.jpg?session=eyJpdiI6Inc3b2MvV....O0cFVeQ=="> // this links opens with te correct image
		
		<img loading="lazy" alt="" src="**/api/file/articles/eyJpdiI6IlZCbmVCU1R0UEFXWG....hZyI6IiJ9?		
			 width=0&amp;height=45&amp;session=eyJpdiI6IktlMzFhY0h...AxZDdlIiwidGFnIjoiIn0=&amp;csrf_name=csrf65cb9251b2186&amp;csrf_value=Ui+pIqBQ8fids056VtazyvMgiFZRhW0/vdYWl7Yt3RO0cFVeQ==" 
		 	 class="ew-image ew-lazy" 
		 	 style="height: 45px">  // this thumbview icon is not created so no image is shown and click to open link as image preview won't work
	 </a>
</span>

The image load for the article and accounts table seems to do someting with the API but what and why?

Any idea's


arbei
User
Posts: 9384

Post by arbei »

You may check HTTP response to see if there is any errors in the HTTP response.


Dadinos2
User
Posts: 52

Post by Dadinos2 »

I finally found the problem.
The image has a width/ height given in de image tag attributes but if you also tick the Resize image then it goes wrong.
Without the Resize image is working as before.

Any reason for this?

Regards,

Aren


arbei
User
Posts: 9384

Post by arbei »

  1. Make sure you have installed the PHP GD library, see Composer.
  2. If there was error during resizing, and you have enabled Debug as suggested, you should see the actual error message in the log file, or in the HTTP response.

Post Reply