-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
JSON Export: Not exporting pinned posts #112
Comments
Exporting the JSON file calls
Which is the better solution:
The first is probably the easiest, but leaves the door open for this bug to appear in other functions. The third satisfies my desire to make things more understandable for future developers (WordPress has similar issues with some of its functions and hooks), but it's more work and might introduce errors if it's not done carefully. The second, I think, splits the difference nicely; it's a non-breaking change even if the names of the functions are imperfect. Thoughts? |
Addendum: It's worth noting that we can't simply duplicate what the CSV/TXT export options do. The CSV and TXT options both refer to I bring this up here but it's potentially fodder for discussion on the forums: should we consider refactoring the export process, so that JSON isn't separate from CSV and TXT? In other words, users could export either just posts, in CSV, TXT, or JSON format, or export user+blogs+posts, also in CSV, TXT, or JSON format. I'm not sure of the rationale behind the CSV+TXT/JSON split, but it seems like it might be useful to merge everything together and allow all three formats for both export options. |
I think I agree with you that option 2 is probably the best compromise between solving both this bug and potential future bugs and also maintaining consistent behaviour so that a complete refactor isn't necessary. Though, as you say, the reason for the split might make a big difference on how we handle this, and a refactor, as difficult as it would be, might be the best option depending on the design philosophy at play here. |
I think the path of least resistance will be best here, as this is one special case where we need to do things differently against several other places in the app where the current setup is correct (i.e. getting posts for displaying blogs via HTML, the API, ActivityPub outbox, etc.). I agree the naming could probably be better, but refactoring won't be worth the time investment / potential stability issues right now. So I'd say we go with the first option, adding a Since both of you have been in that code now, if either of you wants to quickly knock this out, just let us know and assign the task to yourself. Otherwise I'll take care of it when I have some free time. |
I'll pick this one up. @thebaer, on further review, I've noticed an issue, though: |
I've offered two branches off I leave it to you to choose which (if either) to include (the second is easier to maintain but we'll have to remember the new parameter if any new calls are made). |
Describe the bug
Currently, when a user exports their data via JSON, posts in a collection which are pinned are not included in the exported JSON file. This behavior is absent from the txt and csv exports (but IS present for the Prettified export).
Steps to reproduce (if necessary)
Steps to reproduce the behavior:
posts
value (the array will be empty if there are no unpinned posts in that collection).Expected behavior
All posts should be included in the
posts
array, regardless of itspinned_position
value.Application configuration
Version or last commit: 0.9.1
The text was updated successfully, but these errors were encountered: