veda-consulting-company / uk.co.vedaconsulting.mosaico

Other
39 stars 75 forks source link

Placeholder Images Broken After Upgrade to 3.0 #596

Closed themak1985 closed 1 year ago

themak1985 commented 1 year ago

Upgraded to 3.0 and plagued with image issues - on latest wordpress civi 5.61.3 - no image placeholder will show up.

Cleared cache, reloaded permalinks,

Screenshot 2023-06-13 at 10 57 18 AM

I get this error in console. Unable to preventDefault inside passive event listener invocation. I have disabled and enabled it again, but no luck.

This is the path found for an image using devtools.

https://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fmosaico%2Fimg%2Fplaceholder&method=placeholder&params=534%2C150&text=w534

I get the following error: "Internal GD font () not available. Use only 1-5."

bannyachanda commented 1 year ago

Hi,

We are getting a similar error: "Internal GD font () not available. Use only 1-5.". Uploaded images are not showing in the template. We are using CiviCRM version 5.60.0 within Wordpress version 6.2.2 and have installed Mosaico Extension version 3.0.1686233438.

mattwire commented 1 year ago

Fixed in 3.1

bannyachanda commented 1 year ago

Hi @mattwire , After updating the version to 3.1, the error "Internal GD font () not available. Use only 1-5." is not showing anymore. But the image placeholder issue is still there. Uploaded images are not showing in the template. See Screenshot.

Screenshot 2023-06-22 at 10 52 10 AM
mattwire commented 1 year ago

@bannyachanda the placeholder images are the "drop an image here 300 x 200" images which look like are working in your screenshot. For the other images.. what happens if you upload a new image? Also try experimenting with the URL that gives the 404 in the browser console - open it in another window and see if you can see the problem with the path - the filename should exist in the same place on the filesystem.

bannyachanda commented 1 year ago

@mattwire Sorry, the screenshot I am showing is for uploaded images. I have uploaded the image, image upload is working perfectly but it is not displaying in the template. Also, the uploaded images are there in the upload directory. I can access the image src from the browser directly. The problem happens when it's trying to display the image in the template with the URL "http://civicrm.memberlounge.ca/wp-admin/mosaico/img/?src=..."

themak1985 commented 1 year ago

@bannyachanda - I upgraded and do not have the same issues as you do. 3.1 fixed the issue for me.

I suggest doing the following wordpress/civicrm troubleshooting.

clear civicrm cache, reload wordpress permalinks, clear civicrm cache again to be safe, create a new template.

bannyachanda commented 1 year ago

Hi, @themak1985, Thanks for your suggestions.
I already did all of the things you mentioned. But still, it's not working. Even there is no error in the log files.

bannyachanda commented 1 year ago

Hi @mattwire,

I have figured out the problem. The image is loading from this in my Mosaico template https://mysite.com/mosaico/img/?src=.... but it should be loaded from https://mysite.com/civicrm/mosaico/img/?src=....

Can you please suggest to me how can I solve the problem?

themak1985 commented 1 year ago

@bannyachanda are your resource URLs properly set?

bannyachanda commented 1 year ago

@themak1985 Yes I think so. Here it is:

Screenshot 2023-06-23 at 12 28 39 PM
deepak-srivastava commented 1 year ago

@bannyachanda For some reason your urls gone wrong.

You could try replaceurl api to correct them. E.g:

cv api MosaicoTemplate.replaceurls from_url="https://mysite.com/mosaico/img" to_url="https://mysite.com/civicrm/mosaico/img"

Or

drush cvapi MosaicoTemplate.replaceurls from_url="https://mysite.com/mosaico/img" to_url="https://mysite.com/civicrm/mosaico/img"

bannyachanda commented 1 year ago

Hi @deepak-srivastava, I did it. But it didn't resolve the problem. After doing it, I have got this output: { "is_error": 0, "version": 3, "count": 0, "values": [] }