impresspages / ImpressPages

ImpressPages is php framework with admin panel. Build functional website in one hour.
http://www.impresspages.org
Other
501 stars 178 forks source link

Intermittent issues with images not showing in repository #869

Closed TonyWasp closed 6 years ago

TonyWasp commented 6 years ago

Sometimes they show others the empty.gif is called. It's not all the time. It's not cos images are too big either it can happen with small icons. Any ideas on how to fix this would be appreciated.

Thanks

jankus commented 6 years ago

Can you reproduce it every time? Or is it random? Have you tracked what kind of images are failing? Maybe file type is an issue?

TonyWasp commented 6 years ago

It's random. It doesn't matter if it's gif, jpg or png.

TonyWasp commented 6 years ago

Thought it might be the custom theme, but just installed a version with the default air theme and it still happens.

azanov commented 6 years ago

Can you try to resize or scroll the window? Do the images re-appear in this case?

TonyWasp commented 6 years ago

Yeah, that doesn't work.

azanov commented 6 years ago

Can you try opening the developer tools in your browser and check if there are any errors in the console? Also check the network tab to see the server response for the failed requests.

TonyWasp commented 6 years ago

Yep, no errors

TonyWasp commented 6 years ago

This is still an issue. Client now testing and they can't see any images in repository.

TonyWasp commented 6 years ago

screencapture-waspmedia-co-uk-flexenergy-home-1511174538258

TonyWasp commented 6 years ago

Not sure why the screen shot captured multiple pages?

TonyWasp commented 6 years ago

Hold on. Think this might be a clue. If I resize the browser then scroll down they appear?

jankus commented 6 years ago

It could be some custom plugin or external JavaScript library that breaks this. Try on completely fresh installation. ImpressPages prints all images at once. Inspect the difference between elements that show image and those that don't. There must be some clue, errors, empty values etc. Check AJAX response from the server. Do all images get all data? Can you copy/paste their path in the browser and do they show up?

azanov commented 6 years ago

@jankus: The latest repository has lazy loading enabled. Only visible images are loaded. @TonyWasp: Can you tell me which browser you are using and what the exact version of it is?

TonyWasp commented 6 years ago

Chrome latest build (Version 62.0.3202.94)

TonyWasp commented 6 years ago

I tried a clean install, still got the problem. The images did exist when I copied the path.

azanov commented 6 years ago

I could not reproduce the issue with the latest Chrome. I think it makes sense if I can have a closer look at the issue through TeamViewer. Just add me on Skype (pavel_azanov), so we can set up a session some time.

Temporarily I can suggest you to edit this function in your installation to always return true:

https://github.com/impresspages/ImpressPages/blob/master/Ip/Internal/Repository/assets/ipRepositoryAll.js#L82

Change

_isVisible: function (element) {
    var $browser = $('.ipsBrowser'),
        $element = $(element),
        scrollTop = $browser.scrollTop(),
        elementY = $element.offset().top;
    return ((elementY < ($browser.height() + scrollTop)) && (elementY > (scrollTop - $element.height())));
},

to

_isVisible: function (element) {
    return true;
},
TonyWasp commented 6 years ago

Thanks I'll try it and let you know.

koos91 commented 6 years ago

I have the same problem but I think the problem exist because the lazyload is only triggered when the vertical scrollbar for the website itself is at top-position.

When you open the repository you can see two vertical scrollbars, one for the repository and on for the website (when website-height is larger than the viewport). The images inside the repository only appears when the scrollbar of the website is (almost) at the top and you scroll inside the repository.

To reproduce

Tested in Firefox 57.0.2 and Chrome 63.0.3239.84

azanov commented 6 years ago

@koos91 Thanks for testing! I could reproduce the issue and will make a fix

azanov commented 6 years ago

Update is prepared, waiting for it to be included in the latest code

pointtom commented 6 years ago

I am having the same image problem. I seem to old get a few images loaded. On 1st entry I get no images showing at all. If I then scroll I get some only.

azanov commented 6 years ago

@pointtom There's a fix (https://github.com/impresspages/ImpressPages/pull/872) for this bug already, waiting for the PR to be accepted.

pointtom commented 6 years ago

Excellent thanks for that. I do like the CMS. Have integrated my weeWX weather station into it also a webcam.

pointtom commented 6 years ago

@azanov I have made the changes as a tempory fix and all so far is looking good. Thanks for that.