ant-tar / MODX-Polls

A MODx Revolution Polls component to create questions with a dynamic number of answers
http://www.oostdesign.com/portfolio/modx-packages/polls.html
13 stars 19 forks source link

Manager slightly destroyed #53

Open inreti-sb opened 3 years ago

inreti-sb commented 3 years ago

Manager slightly destroyed (light grey bar on top inserted, some CSS statements like padding of menu-item etc. not applying) on first request after flushing cache.

Screenshot: Screenshot_2021-03-18 Dashboard polls bug

On reload (from cache) everything is fine again.

In Developer Tools the title- and meta-tags and all external CSS- and JS-links seem to be moved from head- to body-section!

Even though this extra seems to be very old and unmaintained.. does anyone has an approach?

MODX Revolution 2.8.1-pl polls 1.3.2-pl PHP 7.4.16 Ubuntu 18.04.5 LTS Apache 2

Jako commented 3 years ago

Since Raffy had the same solution for the problem, I looked through the code and this line can be the cause of the issue:

https://github.com/himurovich/MODX-Polls/blob/master/core/components/polls/controllers/mgr/polls_header.php#L14

There is no cleaning on the value …

It has to be removed there. After that MODx.request has to be used in the JS code of the extra replacing Polls.request.

matdave commented 3 years ago

@Jako can you test the PR I submitted. I was unable to "break" my manager, so can't recreate.

Jako commented 3 years ago

I don’t think that the Polls.request value is used somewhere. But I never had that extra installed on my own pages and just saw the result on another site. It was visible from time to time and seemed not reproducible. Maybe @inreti-sb can test it.

inreti-sb commented 3 years ago

Thanks @Jako and @matdave! Unfortunately this PR does not fix it. Does someone needs manager/server access to debug and test it?

Jako commented 3 years ago

Do you have a way to reproduce the issue?

inreti-sb commented 3 years ago

On three of my sites I tested so far (on two different v-servers).. install the extra "polls".. refresh page.. manager is slightly destroyed.

Jako commented 3 years ago

Installing can be done only once. Is it somehow else reproducible after? You told about the first request after clearing the cache. I just have to create a test situation, wether the issue is gone.

inreti-sb commented 3 years ago

I can reproduce this everytime I clear the cache (or reinstall the extra).. afterwards the manager is destroyed, but only on the first request. On every further (cached) request and after uninstalling or deactivating the extra, the appearance is fine again. I will try to reproduce this on a fresh instance without further extras installed.

inreti-sb commented 3 years ago

Okay.. I just reproduced this on a fresh 2.8.1 (advanced) installation with no additional extras. Hope that helps.

Jako commented 3 years ago

Can you check this patch?

inreti-sb commented 3 years ago

Jiiiha, this patch seem to work for me. Thanks a lot, @Jako!

Jako commented 3 years ago

@himurovich Can you merge the fix and release a new version?

ant-tar commented 3 years ago

Sure I will do @Jako Thanks a lot!