@kohanajs/mod-cms
Advanced tools
Comparing version 5.4.0 to 5.4.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [5.4.1](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v5.4.0...v5.4.1) (2022-03-01) | ||
### Bug Fixes | ||
* block and item sort is not order by weight ([b601da2](https://gitlab.com/kohana-js/proposals/level0/mod-cms/commit/b601da2106d1ac3f9ab9ae11d753d0f011a83e4b)) | ||
## [5.4.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v5.3.0...v5.4.0) (2022-02-21) | ||
@@ -7,0 +14,0 @@ |
@@ -98,3 +98,6 @@ const {SQL} = require("@kohanajs/constants"); | ||
const assignItem = (obj, its, prop) => { | ||
its.sort((a, b) => (a.weight || 0) - (b.weight || 0)); | ||
its.forEach(it => { | ||
console.log(it.weight); | ||
obj.items[it.name] = obj.items[it.name] || []; | ||
@@ -121,3 +124,3 @@ const item = JSON.parse(i18nValueJSON); | ||
//add blocks to version | ||
const blocks = await ORM.readBy(PageBlock, 'page_id', [pageId], {database, asArray: true}); | ||
const blocks = await ORM.readBy(PageBlock, 'page_id', [pageId], {database, asArray: true, orderBy: new Map([['weight', 'ASC']])}); | ||
await ORM.eagerLoad(blocks, { | ||
@@ -131,3 +134,3 @@ with:["PageBlockAttribute", "PageBlockValue", "PageBlockItem"], | ||
name: it.name, | ||
attributes:{}, | ||
attributes:{weight: it.weight}, | ||
values:JSON.parse(i18nValueJSON), | ||
@@ -134,0 +137,0 @@ items: {} |
{ | ||
"name": "@kohanajs/mod-cms", | ||
"version": "5.4.0", | ||
"version": "5.4.1", | ||
"description": "The CMS module for KohanaJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63567
1405