User tests: Successful: Unsuccessful:
The post-installation message is wrapped in a <p>
element. When the message has block elements, it generates invalid HTML markup.
Go to Components > Post-installation Messages
View page source
Find:
<p class="small">
Since version 3.5.0 </p>
<p><p>Since Joomla! 3.5 a statistics plugin will submit anonymous data to the Joomla Project. This will only submit the Joomla version, PHP version, database engine and version, and server operating system.</p><p>This data is collected to ensure that future versions of Joomla can take advantage of the latest database and PHP features without affecting significant numbers of users. The need for this became clear when a minimum of PHP 5.3.10 was required when Joomla! 3.3 implemented the more secure Bcrypt passwords.</p><p>In the interest of full transparency and to help developers <a href="https://developer.joomla.org/about/stats.html">this data is publicly available.</a> An API and graphs will show the Joomla version, PHP versions and database engines in use.<br><br>If you do not wish to provide the Joomla Project with this information you can disable the plugin called System - Joomla Statistics.</p></p>
<div>
<a href="index.php?option=com_postinstall&view=message&task=unpublish&id=3&bb8fbd385e4c3cce23b936c5fa28591d=1" class="btn btn-inverse btn-small">
Hide this message </a>
</div>
<p class="small">
Since version 3.5.0 </p>
<div>
<p>Since Joomla! 3.5 a statistics plugin will submit anonymous data to the Joomla Project. This will only submit the Joomla version, PHP version, database engine and version, and server operating system.</p><p>This data is collected to ensure that future versions of Joomla can take advantage of the latest database and PHP features without affecting significant numbers of users. The need for this became clear when a minimum of PHP 5.3.10 was required when Joomla! 3.3 implemented the more secure Bcrypt passwords.</p><p>In the interest of full transparency and to help developers <a href="https://developer.joomla.org/about/stats.html">this data is publicly available.</a> An API and graphs will show the Joomla version, PHP versions and database engines in use.</p><p>If you do not wish to provide the Joomla Project with this information you can disable the plugin called System - Joomla Statistics.</p> <a href="index.php?option=com_postinstall&view=message&task=unpublish&id=3&bb8fbd385e4c3cce23b936c5fa28591d=1" class="btn btn-inverse btn-small">
Hide this message </a>
</div>
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_postinstall |
Pretty sure this is not the correct fix although you do correctly identify an issue
The issue you identified is coming the language string COM_CPANEL_WELCOME_BEGINNERS_MESSAGE
COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="<p>Community resources are available for new users</p><ul><li><a href="_QQ_"https://docs.joomla.org/Portal:Beginners"_QQ_">Joomla! Beginners Guide</a></li><li><a href="_QQ_"https://forum.joomla.org/viewforum.php?f=706"_QQ_">New to Joomla! Forum</a></li></ul>"
@C-Lodder any thoughts?
There is also the <ul>
element which would make it invalid inside the <p>
element.
We really must stop putting markup inside strings :(
There's no point in using a <div>
tag. Both <div>
and <p>
are block elements, and neither need to be wrapped in one another.
So replace:
<div><?php echo JText::_($item->description_key); ?></div>
with:
<?php echo JText::_($item->description_key); ?>
or there is an opening <div>
just below, so it could go inside there. Take your pick.
Labels |
Added:
?
|
That won't work as now you have other messages without any block element
You're saying some language packs have translated this without the HTML markup?
That is possible but no thats not what I meant. If you look at the other post installation messages you will see that they are not wrapped in a block element so this change to remove the enclosing element from the code will cause invalid markup elsewhere. The problem is using markup in this string. Not in the code this PR edits
COM_CPANEL_MSG_ROBOTS_BODY="A change to the default robots.txt files was made in Joomla! 3.3 to allow Google to access templates and media files by default to improve SEO. This change is not applied automatically on upgrades and users are recommended to review the changes in the robots.txt.dist file and implement these changes in their own robots.txt file."
COM_CPANEL_MSG_STATS_COLLECTION_BODY="Since Joomla! 3.5 a statistics plugin will submit anonymous data to the Joomla Project. This will only submit the Joomla version, PHP version, database engine and version, and server operating system.<br><br>This data is collected to ensure that future versions of Joomla can take advantage of the latest database and PHP features without affecting significant numbers of users. The need for this became clear when a minimum of PHP 5.3.10 was required when Joomla! 3.3 implemented the more secure Bcrypt passwords.<br><br>In the interest of full transparency and to help developers <a href="_QQ_"https://developer.joomla.org/about/stats.html"_QQ_">this data is publicly available.</a> An API and graphs will show the Joomla version, PHP versions and database engines in use.<br><br>If you do not wish to provide the Joomla Project with this information you can disable the plugin called System - Joomla Statistics."
Hmm ok. Well you can wrap it in the <div>
but they don't have any default styling unlike <p>
, so as a temporary fix, you may want to add a class to the <div>
and style the text appropriately.
Or remove the HTML markup from the language string
Or go a dirty route and use PHP to remove the <p>
tags from the language string if they exist.
Personally I'd prefer option 2, but not sure if editing the language string like that will be allowed for a minor release.
We can change the string to remove the p and to replace the li with br - then it will validate etc
thats not a problem to do. Translators will moan that its a useless change but cant do anything about that.
So replace the unordered list with line breaks? Should each list item be prefixed *
or -
or nothing?
Your choice. See what looks best
In the 1st message, it uses <br>
. In the Two Factor...
message, it uses <br />
. Is there a preference on which format?
Please use <br>
. I've already remove ALL void tags on Joomla 4 and I don't want anymore going in when it gets merged :)
Pretty sure that it should be without / as it should be html5
Yup, but half of J3 is still XHTML
Category | Administration com_postinstall | ⇒ | Administration Language & Strings |
Labels |
Added:
?
|
@brianteeman @C-Lodder Thanks for the tips. Ready for testing.
I have tested this item
IMHO each post install message should be wrapped inside a div
, not a p
that way you could have block level HTML tags inside a post install message (ul, ol, table, h[1-6], etc) - is more flexible that way.
Notice the same logic applies to the message container. Example:
<div class="alert-message">Database table structure is up to date.</div>
@andrepereiradasilva See this comment
I agree with you too. I noticed the following in that comment so I will rework it later today.
or there is an opening <div> just below, so it could go inside there. Take your pick.
Category | Administration Language & Strings | ⇒ | Administration com_postinstall Language & Strings |
Ready to be tested. Thanks.
Instructions are the same except the markup is different.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-08-14 11:34:37 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
|
I have tested this item✅ successfully on c1833e4
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14817.