User tests: Successful: Unsuccessful:
On installing Joomla 4.0-dev today I was confronted with this in the Home Dashboard:
As I personally had worked on the Empty State design for modules I know this was changed since my work, so I went hunting and found the recent changes in https://github.com/joomla/joomla-cms/pull/34257/files
The problem is, after a clean install of Joomla 4.0-dev, the params for com_content
do not contain a valid for record_hits
and therefore the code added in #34257 below, will return false
if (!ComponentHelper::getParams('com_content')->get('record_hits'))
If you check the article options, right after clean install, you see the toggle is on for the feature, but this is an assumed default and not actually in the database params
DB Params for com_content
in #_extensions
table: after clean install (Note there is no record_hits
in this)
{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_tags":"1","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_links":"4","show_subcategory_content":"0","link_intro_image":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0","sef_ids":1}
HOWEVER, Joomla (rightly or wrongly) assumes the default of 1
for record_hits
if it is not set, when actually recording hits (this is done in this code block below), and when displaying the Article Options after a clean install.
Therefore, in order to rightly assume that the recording of hits is disabled, enough to tell the user it is disabled, we have to apply the same logic, and set a default of 1 throughout
if (!ComponentHelper::getParams('com_content')->get('record_hits', 1))
see above
This in the module gives the game away - its a lie - hits is not disabled :-)
// @chmst @brianteeman @richard67 @Abernyte-Git @SharkyKZ @Quy
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content Modules Libraries Front End |
Title |
|
b/c for one. The rare case that someone has installed Joomla before, and never ever saved the article options.
For 4.0.x fresh installs - we should and Im trying to add that now.
Labels |
Added:
?
|
Category | Administration com_content Modules Libraries Front End | ⇒ | Administration com_content Modules SQL Installation Postgresql Libraries Front End |
roflmao - guess you're not perfect after all. the pr that introduced the condition was not the one you referenced but one that you tested yourself and said was good. ;) haha
05d7440 adds the defaults on fresh installations installation
roflmao - guess you're not perfect after all.
I never said I was?
the pr that introduced the condition was not the one you referenced but one that you tested yourself and said was good. ;) haha
The PR that was "in my face" tonight after a fresh install was the one referenced that made changes to the home dashboard module. I do not know which other one you refer to?
Looking again at https://github.com/joomla/joomla-cms/pull/34257/files changes those are the ones ...
I have tested this item
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-06-02 19:02:11 |
Closed_By | ⇒ | chmst | |
Labels |
Added:
?
|
Thanks
why not set the value in the db on install?