Commit 2be8f57b authored by Sigrid Suski's avatar Sigrid Suski
Browse files

(#) Sorting categories in category field by position doesn't reflect changes...

	(#) Sorting categories in category field by position doesn't reflect changes if cache is on (Issue #25)
parent 2bc74283
......@@ -35,6 +35,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
(#) Unpacking of Sobi Framework in case of missing Phar support works now (Issue #80)
(#) Error 500 instead of 404 for undefined tasks (URL addresses) (Issue #97)
(#) Sorting categories in category field by position doesn't reflect changes if cache is on (Issue #25)
### 1.4.7.2 (8 May 2018)
......
......@@ -258,6 +258,8 @@ final class SPCache
if ( $file ) {
SPFs::delete( $file );
}
SPFactory::cache()
->addVar( null, 'categories_tree', Sobi::Section() );
return $this;
}
......
......@@ -55,9 +55,9 @@ class SPCategoryAdmCtrl extends SPCategoryCtrl
break;
case 'reorder':
$this->authorise( 'edit' );
SPFactory::cache()->cleanCategories();
$r = true;
$this->reorder();
SPFactory::cache()->cleanCategories();
break;
case 'up':
case 'down':
......
......@@ -435,8 +435,9 @@ class SPField_Category extends SPFieldType implements SPFieldInterface
protected function loadCategories()
{
if ( ( !( $this->_cats ) || !( count( $this->_cats ) ) ) && SPLoader::path( 'etc.categories.' . Sobi::Lang( false ) . '-' . Sobi::Section(), 'front', true, 'json' ) ) {
$this->_cats = json_decode( SPFs::read( SPLoader::path( 'etc.categories.' . Sobi::Lang( false ) . '-' . Sobi::Section(), 'front', true, 'json' ) ), true );
$catFile = SPLoader::path( 'etc.categories' . Sobi::Lang( false ) . '-' . Sobi::Section(), 'front', true, 'json' );
if ( ( !( $this->_cats ) || !( count( $this->_cats ) ) ) && $catFile ) {
$this->_cats = json_decode( SPFs::read( $catFile ), true );
}
if ( !( $this->_cats ) || !( count( $this->_cats ) ) ) {
$this->_cats = SPFactory::cache()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment