3

I have observed the same behavior when installing Joomla from multiple so called Quick Start Packages embedding themes and plugins. Right now, I have installed, Basic Joomla running on a production server and the same issue persists:

Whenever an article is saved, the content is wrapped within a <p></p> tag which is visible to end users. So initially you'll write:

My text

But after saving the article, you see:

<p>My text</p>

And if you save it again it becomes:

<p><p>My text</p><p>

...and so on.

So if you save the article 10 times, you'll get 10 p tags surrounding the text, and these tags are not source code, they are user-visible.

I initially suspected some plugins; there is the JCE Editor and TinyMCE installed. I disabled TinyMCE, but the behavior persisted. I read somewhere about disabling the surrounding container option in JCE Editor, but it didn't help. So I am not sure that the issue really comes from the editor.

I however also found forum posts about Joomla's Text Filter, so I made sure to disable the text filter but without success: the issue persisted.

Since the issue persists across Joomla reinstalls, I am led to think, that maybe our server environment is the problem, maybe our PHP production settings are causing this, but this gets into the territory of [spam].

We do not normally use the PHP stack, we only set it up to "quickly help" a client get going with a basic project, but boy, this stack is so fragile. Especially when you add CMS in the mix. The issue can be anywhere and you need to go look for Easter Eggs. Nothing to do with Java and its compile time errors and runtime stacktraces in terms of robustness.

But back to the main problem, I do not know where the issue is at this point. We spent about two weeks trying to get the out-the-box experience work. We thought it would be a matter of 2 hours, half a day at most.

Part of this was because of the fragility of PHP mixed with our incompetence with this stack (missing PHP modules, yielding obscure error messages, and since we had no experience we had to hunt), part of this was due the buggy Quick Start Packages that our client insisted to use initially despite our security warning (you do not know the code you are running with these heavily modified, in the age of ransomware, better stick to the official source code), and part of this was due to the issue I am describing in this thread. I even got to the point of wondering if MySQL wasn't somehow adding the tags, but I don't even want to consider the possibility....

Any solution/idea/pointer would be greatly appreciated.

We are running the latest stable Joomla version (3.9.4), with only default plugins, and all of them are updated. But once again, we experienced this problem even with older versions of Joomla shipped with the Quick Start Packages, so I do not think this is a version specific problem.

  • Do you have a Joomla environment not having this issue that you can compare the the PHP Settings with your problem Joomla site or alternatively take a copy of the failing Joomla site and load it up on a local server or another hosting company? From your description it seems to me to be a PHP set up type issue for your server as the problem crosses Joomla installations. – Irata Apr 4 at 22:29
  • Have you tried disabling the TinyMCE editor? I never usr this editor but it could be causing the problem – Lodder Apr 5 at 7:05
  • Thank you all for your help! @Irata I had the same idea but unfortunately it is quite difficult to identify what would cquse the issue, I see no obvious relevant difference between the development php.ini and the production php.ini. – Samuel Apr 5 at 14:53
  • @Lodder yes I have tried disabling this editor but unfortunately it didn't solve the issue. Extra p wrappers kept being added on every save. – Samuel Apr 5 at 14:54
0

With tinymce default editor enabled, You can change the code snippet in file - [root]\plugins\editors\tinymce\tinymce.php around line 685 from :

<code>$scriptOptions['force_p_newlines']  = true;
        $scriptOptions['forced_root_block'] = 'p';</code>

to

<code>$scriptOptions['force_p_newlines']  = true;
        $scriptOptions['forced_root_block'] = false;</code>

which will result in disabling of root block element being paragraph by default

  • Are you recommending adjusting core files? Please provide an upgrade-safe technique. – mickmackusa Apr 6 at 22:41
  • Yes, had suggested adjusting core files. I doubt if plugin - tinymce specific file could be created for override using template override method although had tried creating similar instance of the file above in here - \templates[template_name]\html\layouts\joomla\plugins\editors\tinymce and made similar edit in the file however change isnt reflecting The user can make this suggestion in joomla.org forum if he wishes to have tried and tested upgrade-safe method Otherwise, Similar file can be copied from backup and made to replace the upgraded file :) – Amandeep singh Apr 7 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.