fnagel / beautyofcode

TYPO3 CMS Extension beautyofcode
https://extensions.typo3.org/extension/beautyofcode/
GNU General Public License v2.0
6 stars 8 forks source link

Fix the bug when deleting a page. #39

Closed emmguyot closed 2 years ago

emmguyot commented 2 years ago

Fix the bug when deleting a page. This bug is the same as reported in #14 but it occurs with release 4.2

emmguyot commented 2 years ago

Sorry, the problem is wider : If the first access is from BE after the clean cache operation, then the code isn't beautified in FE. I need to investigate a bit more and update this pull request

fnagel commented 2 years ago

Thanks for the PR! Even if its not the final solution ;-)

Your second issue looks a lot like #17. Take a look, you might find some useful information.

emmguyot commented 2 years ago

You're right. I've forgotten this issue I investigated 2 years ago. I'll comment there until I've finished my patch

emmguyot commented 2 years ago

I think it's ok : It solves both #14 and #17

fnagel commented 2 years ago

@emmguyot Did you find a way to test this bug reliable? I've seen the error on my own website but was never able to reproduce it in order to investigate. Any hint how to test this?

emmguyot commented 2 years ago

@emmguyot Did you find a way to test this bug reliable? I've seen the error on my own website but was never able to reproduce it in order to investigate. Any hint how to test this?

Sure, I'm using it on my website and it works fine. What kind of error have you got ?

My config : PHP 7.4.15, Typo3 10.4.15

emmguyot commented 2 years ago

If you want to reproduce the #14 and #17 bugs, here are what I've done.

14 : with previous release

17 : With a release where there is a condition in tx_beautyofcode_domain_model_flexform.php whether we are in BE ou not (As I've tried at first in this PR)

fnagel commented 2 years ago

What kind of error have you got ?

Error as in no JS powered highlighting in place, at least from time to time. Sounds like the bug described in #17

My config : PHP 7.4.15, Typo3 10.4.15

My config looks quite similar.

Regarding the bugs:

14 : with previous release

Same thing, but I was confident this was fixed back in the days. I remember reproducing and fixing it. But it might occur again, but my TYPO3 10 instance works just fine with current master.

17 : ...

Help me out here. When you say "Access or create a content for this plugin" you mean create a new instance of the plugin? Or modifying an existing one? I was not able to reproduce this, neither with or without BE auth.

emmguyot commented 2 years ago

14 : with previous release

Same thing, but I was confident this was fixed back in the days. I remember reproducing and fixing it. But it might occur again, but my TYPO3 10 instance works just fine with current master.

Well I had the problem with the 4.2.0 release. According to the commits since that release, there is no way it may have changed with the current master. So it looks strange. I haven't tested it with a clean fresh install of Typo3, maybe that's the point.

17 : ...

Help me out here. When you say "Access or create a content for this plugin" you mean create a new instance of the plugin? Or modifying an existing one? I was not able to reproduce this, neither with or without BE auth.

Access > Means only open the BE to an existing instance of the plugin. It's enough to make Typo3 build the cache of $GLOBALS['TCA'] Create > Enter the form to create a new instance of the plugin.

If you're using the current master, you won't get the bug. But to fix the #14 as it was previously fixed, it reveals this bugs again. Check previous commits where test was done in ext_tables.php (e.g. line 9 of commit d3550bb5643581588fa8da871de66ddb6c40c90c) to build the $GLOBALS['TCA'] according to FE ou BE access. At first, I've tried to set back this test that disappeared from commit f5da486addbc2f10959893c1633a816c487b63ee. And then, I got this bug again.

fnagel commented 2 years ago

Sorry, I'm a little confused here. Commit f5da486addbc2f10959893c1633a816c487b63ee has never been merged actually. And I'm really not sure which version of the code I need to checkout. Diff between master and the 4.2.0 release shows no relevant changes for those issues.

Let me summarize this. We have two bugs:

1) The "code is not highlighted" bug #17 2) The "page delete" bug #14

My questions are: Which bug is is still present in current master and / or latest release (which is 4.2.0)? Which bug does this PR in its current state fix?

emmguyot commented 2 years ago

The bug #14 is present with the latest release.

fnagel commented 2 years ago

So issues #17 is not addressed in this PR? I will try to reproduce #14 again in the 4.2.0 release.

emmguyot commented 2 years ago

Right, the issue #17 isn't present in the master so this PR doesn't address it. But this PR changes how #17 was fixed, that's why I mentioned it. Anyway, feel free to change the description.

fnagel commented 2 years ago

Ahh okay, I think I misunderstood because #17 is not fixed yet.

Anyway, I was able to reproduce #14 in the latest 4.2.0 release by the following steps: create page, create plugin, remove page. I'm using TYPO3 10.4.21 with PHP 7.4.12.

Any idea if this already occurred in TYPO3 9.x?

fnagel commented 2 years ago

Merged manually (minor changes and commit message adjustment) in fed4dd2182107d9c58872cfcc847854fed486ea0

Thanks for the contribution!

emmguyot commented 2 years ago

Any idea if this already occurred in TYPO3 9.x?

I don't know