recidive / choko

Choko Framework
http://choko.org
MIT License
25 stars 9 forks source link

Override query Type object #265

Closed jardix22 closed 9 years ago

jardix22 commented 9 years ago

We are using Type Content to create subtypes as Media, Video and Audio. I have bug when try create pages to list subtypes.

video-list.page.json

{
  "type": "list",
  "title": "Videos",
  "description": "The videos page.",
  "itemType": "content",
  "path": "/media/videos",
  "query": {
    "type": "video"
  },
  "listStyle": "list-group",
  "itemDisplay": "list-group-item"
}

Then in the line 180 of choko controller, we override the type into the query object with the query object from the video-list.page.json.

console.log(query) // {type: 'content'}
console.log($scope.view.query) // {type: 'video'}

 if ($scope.view.query) {
     angular.extend(query, $scope.view.query);
 }

console.log(query) // {type: 'video'} 

In the end this create a bad url.

recidive commented 9 years ago

Duplicate of #199.