Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post order no longer working in Beta13? #288

Closed
henmaker opened this issue Oct 25, 2016 · 9 comments
Closed

Post order no longer working in Beta13? #288

henmaker opened this issue Oct 25, 2016 · 9 comments
Labels

Comments

@henmaker
Copy link

I just tried the latest beta13 today, notice this custom order (sort order) no longer working, no matter by title, menu_order etc. It is still sort by date.

POST PAGES

"posts":
"query":
"per_page": 5
"filter[orderby]": "title"
"filter[order]": "asc"
"filter[post_status]": "publish"

@henmaker
Copy link
Author

i think i found the problem, is not the query not working, is the taxonomiesPosts affected the category posts listed, if have a different query in taxonomiesPosts, it will sort by that query..
In that's the case, seems like we don't have the way to have different sort order for custom taxonomy vs post category, am i correct?

Example. If i define:

TAXONOMIES

"taxonomiesPosts":
"query":
"per_page": 7
"filter[orderby]": "title"
"filter[order]": "asc"

Then when i call the menu link via:
{
"type": "internal",
"trans": "Blog",
"route": "public.taxonomies.slug({ term: 'category', slug: 'blog', postType: 'post' })",
"icon" : ""
}

The blog listing will be orderby title, not date, even i define
"post":
"query":
"filter[orderby]": "date"
"filter[order]": "asc"
"comments":
"enabled": false

This not going to help, as seems like that is only for home page, which is the default listing only...

@shprink
Copy link
Collaborator

shprink commented Oct 26, 2016

Can you explain what you are trying to do concisely?

Using a conf like that:

"taxonomiesPosts":
    "query":
        "orderby": "title"
        "order": "desc"

will affect the order of custom taxonomies items. All of them in the same way. If you list posts or pages it will be the same. For now that's what we have.

image

"taxonomiesPosts":
    "query":
        "orderby": "title"
        "order": "asc"

image

I can understand that you would expect the post query to be used here but that's not the case.

"post":
    "comments":
        "enabled": true
        "depth": 2
        "per_page": 50
    "cache":
        "maxAge": 10800000
        "capacity": 10

I will make this happen in v3.

@shprink shprink added the bug label Oct 26, 2016
@shprink shprink added this to the v3.0.0 (#ionic2) milestone Oct 26, 2016
@henmaker
Copy link
Author

Thanks shprink, this is a great script, i would suggest if possible, to make a query that available for each taxonomiesPosts.

Example, if i have a custom post type call Event, and another custom post type is Food, which i have a custom Taxonomies assigned to Event post type which is by Events type, and Food Types for Food custom post type.

For taxonomiesPosts,
I can define the Event types to be sort by date, but I do not want of "Food types" sort by date, but by title.

If we can define taxonomiesPosts to have a unique key say:

"taxonomiesPosts": "query": "term": "food_types" "orderby": "title" "order": "asc"

That will be great, since we can sort the post type according to the term we define in config.

And if possible, make customPosts to have something like this, that will be awesome. As currently, customPost query is apply to all custom post type, if there is options like:

"customPosts": "query": "post_type": "food" "orderby": "title" "order": "asc"

then that will be great. Just a suggestion, i saw some one suggest to define query in "menu.json" but i think config should be the right way, just like how we can define sorting in our wordpress function.php.

Keep up the good job, appreciate the hard works, i will contribute to make this script better too.

@shprink
Copy link
Collaborator

shprink commented Oct 27, 2016

We can easily do something like this:

"taxonomiesPosts":
    "query":
        "orderby": "title"
        "order": "asc"
    "post"
        "query":
            "orderby": "date"
            "order": "asc"
    "page"
        "query":
            "orderby": "date"
            "order": "desc"

taxonomiesPosts.query would be the default and if taxonomiesPosts.post exists when we want to display posts then we will use it.

would this be ok for your use case?

@henmaker
Copy link
Author

Hi shprink, you mean, this is a new query for your new version or this query can be use in beta13? As i tried, it return the error message:

./config/config.cson
Module build failed: [stdin]:50:5: error: unexpected newline
"post"
^
@ ./lib/config.js 13:24-56

@henmaker
Copy link
Author

Hi shprink, after update to beta14, and run the sudo npm run android to deploy into androids and using Chrome inspector, i notice there is this error:

TypeError: Object.assign is not a function
at _default.getMergedQuery (file:///android_asset/www/bundle-a8687f.js:126066:28)
at _default.doLoadMore (file:///android_asset/www/bundle-a8687f.js:126030:31)
at _default.init (file:///android_asset/www/bundle-a8687f.js:126001:26)
at fn (eval at (file:///android_asset/www/bundle-a8687f.js:27900:16), :2:252)
at Controller.destination.(anonymous function) as onLoad
at Controller.load (file:///android_asset/www/bundle-a8687f.js:129309:24)
at file:///android_asset/www/bundle-a8687f.js:129296:24
at file:///android_asset/www/bundle-a8687f.js:32585:32
at completeOutstandingRequest (file:///android_asset/www/bundle-a8687f.js:19456:11)
at file:///android_asset/www/bundle-a8687f.js:19732:8(anonymous function) @ console-via-logger.js:174(anonymous function) @ bundle-a8687f.js:27056(anonymous function) @ bundle-a8687f.js:23769(anonymous function) @ bundle-a8687f.js:32588completeOutstandingRequest @ bundle-a8687f.js:19456(anonymous function) @ bundle-a8687f.js:19732

Any ideas why? I'm using clean install also the same... When run iOS emulator and check, no such error...

@shprink
Copy link
Collaborator

shprink commented Oct 31, 2016

damn, I should have used angular.merge ... Object.assign is ES6

@shprink
Copy link
Collaborator

shprink commented Oct 31, 2016

#294

I fixed it but have not tested. please try it out on develop or copy manually the change

@henmaker
Copy link
Author

henmaker commented Nov 1, 2016

Thanks it is fine now

pinkasey added a commit to pinkasey/activegan that referenced this issue May 18, 2018
added default config.cson
(cherry picked from commit 3a1eab2)

committing default config.xml
(cherry picked from commit 634daf3)

config.xml that works

add hebrew

change preferred language to hebrew

add icon and splash-screen

ignore DS_Store files - they belong to CrashPlan i think. On my new Mac

Adding siksik to the list :)

Update zh.cson

Add four words:ru、tr、enabled、pushNotifications,fix three words!

Resolving issue wordpress-clients#221

Resolving issue wordpress-clients#221

bump beta09

hebrew working, changed menu, overide some templates, added files to repository
changed .gitignore, which might be a mistake, and i'll look into that

clean up menue, posts seem to work fine, still need to set order

Adding missing  !default

Adding Trou Idees TI app

Update AbstractItemService.js

Update AbstractListService.js

Add the taxonomy term to the cache same modification to file AbstractItemService.js

adding the way to update the font

Adding some more ios apps!

another great app!

upgrade to android API-23

keeping an iOS implementation of notif count for reference

update crosswalk

bump

added keystore

vidoes are now pressented in post list, so there is no need to open post. Ive tried narrowing the "access" and "allow-navigation urls, but then the videos didnt play. need to play with this more."

push notification and package change

Update AbstractItem.js

The post is not refreshed after a pull to refresh
Below is the modification in line 22 to clear the cache :
this.service.clearCache();

Changed the dutch translations, removed a typo and added new strings!

Adding another great app: CommonTales

Two new apps!

adding missing command

new iOS app

update Prerequisites versions

new android app

preparing beta11

use templates for author/authors views

fix wordpress-clients#59 encoding problem

Fetching categorie/tag/custom names from post list to update page title

remove native transitions

ios 10 ready

fix wordpress-clients#59 encoding problem in my posts-list.html

support orderby menu_order

order posts by menu_order, when choosing category

upped the version for fixing post order issue when choosing category

overriding categories list template, to add image to each category

category images

New embedded path. Closes wordpress-clients#279

Author -> Autor

Author is in German: Autor
Plural: Autors -> Autoren

adding docs for a new issue wordpress-clients#278

Custom Menu Logo

Cleanup

Prep for dist

Update config.default.cson

Logo Image in /config/logo.png

forgot default

adding manifest for progressive web apps

adding serviceWorker support. Disabled by default

service workers docs

remove share button when on browser

bump beta13

use https version of my web service

Fix Pagination on customPosts. Closes wordpress-clients#283

Update Build,md

Typo error

Update Dutch Translations

While using the app I noticed some translations were not in context or inline with WordPress translations. Changed those!

custom post and custom taxo queries are customizale through the conf. Closes wordpress-clients#288

add a scss variable for the menu bar title with icon

bump beta 14

migrate to yarn

Removes ES6 code that needs a polyfill

bump beta15 due to a critical bug...

Replace baseUrl http:// with https://

Fix this error on first start :

```XMLHttpRequest cannot load https://dev.julienrenaux.fr/wp-json/... The 'Access-Control-Allow-Origin' header has a value 'http://null' that is not equal to the supplied origin. Origin 'null' is therefore not allowed access.```

Update Build.md

Typo error

add new iOS app

upgrade cordova-ios and cordova-android

add more logs for admobs

upgrade crosswalk

bump beta16

Update AbstractItem.js

The post is not refreshed after a pull to refresh
Below is the modification in line 22 to clear the cache :
this.service.clearCache();

Changed the dutch translations, removed a typo and added new strings!

Adding another great app: CommonTales

Two new apps!

adding missing command

new iOS app

update Prerequisites versions

new android app

preparing beta11

use templates for author/authors views

fix wordpress-clients#59 encoding problem

Fetching categorie/tag/custom names from post list to update page title

remove native transitions

ios 10 ready

New embedded path. Closes wordpress-clients#279

Author -> Autor

Author is in German: Autor
Plural: Autors -> Autoren

adding docs for a new issue wordpress-clients#278

Custom Menu Logo

Cleanup

Prep for dist

Update config.default.cson

Logo Image in /config/logo.png

forgot default

adding manifest for progressive web apps

adding serviceWorker support. Disabled by default

service workers docs

remove share button when on browser

bump beta13

use https version of my web service

Fix Pagination on customPosts. Closes wordpress-clients#283

Update Build,md

Typo error

Update Dutch Translations

While using the app I noticed some translations were not in context or inline with WordPress translations. Changed those!

custom post and custom taxo queries are customizale through the conf. Closes wordpress-clients#288

add a scss variable for the menu bar title with icon

bump beta 14

migrate to yarn

Removes ES6 code that needs a polyfill

bump beta15 due to a critical bug...

Replace baseUrl http:// with https://

Fix this error on first start :

```XMLHttpRequest cannot load https://dev.julienrenaux.fr/wp-json/... The 'Access-Control-Allow-Origin' header has a value 'http://null' that is not equal to the supplied origin. Origin 'null' is therefore not allowed access.```

Update Build.md

Typo error

add new iOS app

upgrade cordova-ios and cordova-android

add more logs for admobs

upgrade crosswalk

bump beta16

bump 2.0.0

Adding docs about how to use crosswalk lite

adding accordion!

forgot to mention crosswalk version

update prerequisites

Fix typo showing MD file on Github

Fix typo on Google

Fix typos on BUILD.md

Fix Debug command

Update pt translation

new app

Open links in a comment in Safari

Links in a comment open in app and not in Safari / default Browser. Adding prepLink to commentCtrl.comment.content.rendered fix this issue.

update cordovaPlugins version

i tested these newest Plugins on Android and IOS, all is right!

WordPress 4.7 ready. Closes wordpress-clients#308

bump 2.0.0

wp 4.7 ready

tmp before rebase with upstream

fix error css about wp-caption

now image in post can show center!

Update CHANGELOG.md

Update CHANGELOG.md

update dependencies,tested it!

now no “Can't run npm run restore” questions,byebye ionic.project!

rollback cordova plugin upgrade (until fixed)

bump 2.0.1

rebased to comply with wp 4.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants