Skip to content

Commit 3b6c5a7

Browse files
author
Ben Thomson
committedJun 9, 2020
Bust browser cache for JS and CSS assets
Some users have reported a error when modifying menus, as their JS files were still cached, therefore they were sending full arrays back to the controller. This fix should encourage their browsers to download the latest JS files. Refs: https://github.com/rainlab/pages-plugin/commit/fc99d037f075e4093c2fc640862e7ce122ad32de\#r39741923
1 parent a1210a4 commit 3b6c5a7

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed
 

‎controllers/Index.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ public function __construct()
9999
public function index()
100100
{
101101
$this->addJs('/modules/backend/assets/js/october.treeview.js', 'core');
102-
$this->addJs('/plugins/rainlab/pages/assets/js/pages-page.js');
103-
$this->addJs('/plugins/rainlab/pages/assets/js/pages-snippets.js');
104-
$this->addCss('/plugins/rainlab/pages/assets/css/pages.css');
102+
$this->addJs('/plugins/rainlab/pages/assets/js/pages-page.js', 'RainLab.Pages');
103+
$this->addJs('/plugins/rainlab/pages/assets/js/pages-snippets.js', 'RainLab.Pages');
104+
$this->addCss('/plugins/rainlab/pages/assets/css/pages.css', 'RainLab.Pages');
105105

106106
// Preload the code editor class as it could be needed
107107
// before it loads dynamically.

‎formwidgets/MenuItems.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MenuItems extends FormWidgetBase
3131
public $urlRequiredMessage = 'rainlab.pages::lang.menuitem.url_required';
3232

3333
public $cmsPageRequiredMessage = 'rainlab.pages::lang.menuitem.cms_page_required';
34-
34+
3535
public $newItemTitle = 'rainlab.pages::lang.menuitem.new_item';
3636

3737
/**
@@ -80,7 +80,7 @@ public function prepareVars()
8080
*/
8181
protected function loadAssets()
8282
{
83-
$this->addJs('js/menu-items-editor.js', 'core');
83+
$this->addJs('js/menu-items-editor.js', 'RainLab.Pages');
8484
}
8585

8686
/**
@@ -98,7 +98,7 @@ public function getSaveValue($value)
9898
/**
9999
* Returns the item reference description.
100100
* @param \RainLab\Pages\Classes\MenuItem $item Specifies the menu item
101-
* @return string
101+
* @return string
102102
*/
103103
protected function getReferenceDescription($item)
104104
{

‎updates/version.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@
5050
1.3.1: Added ChildPages Component, prevent hidden pages from being returned via menu item resolver.
5151
1.3.2: Fixes error when creating a subpage whose parent has no layout set.
5252
1.3.3: Improves user experience for users with only partial access through permissions
53-
1.3.4: Fix error where large menus were being truncated due to the PHP "max_input_vars" configuration value. Improved Slovenian translation.
53+
1.3.4: Fix error where large menus were being truncated due to the PHP "max_input_vars" configuration value. Improved Slovenian translation.
54+
1.3.5: Minor fix to bust the browser cache for JS assets. Prevent duplicate property fields in snippet inspector.

2 commit comments

Comments
 (2)

mjauvin commented on Jun 9, 2020

@mjauvin
Contributor

@bennothommo that would be why I still got the cached version after upgrading.

Thanks for fixing this.

bennothommo commented on Jun 9, 2020

@bennothommo
Contributor

No worries @mjauvin

Please sign in to comment.