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 creation date is forced at the data repository level but it should be done on the API controller #4072

Open
tuxpiper opened this issue Sep 10, 2020 · 1 comment

Comments

@tuxpiper
Copy link
Member

tuxpiper commented Sep 10, 2020

Currently we've got this line of code

https://github.com/ushahidi/platform/blob/d6c575f/src/App/Repository/PostRepository.php#L1177

forcing the post creation date at the model/repository level, whenever we create a post in the database. This is generally reasonable behavior, but it doesn't work well when we are doing i.e. data import using our repository classes. This sort of thing rather belongs at the API level.

Setting the creation date at the model/repository level still needs to happen, but only if no date has been set for the Post entity.


On our v5 branch, this is already being done at the HTTP controller level:

https://github.com/ushahidi/platform/blob/f9e2fdf/v5/Http/Controllers/PostController.php#L113

but are we setting a proper default at the model level? Couldn't find anything explicit here:

https://github.com/ushahidi/platform/blob/f9e2fdf901d10939899a67b1c35ff2633fb47a98/v5/Models/Post.php

Could you please confirm this @rowasc?

Aha! Link: https://ushahiditeam.aha.io/features/PROD-788

@tuxpiper tuxpiper added the Bug label Sep 10, 2020
@tuxpiper tuxpiper added this to In progress in Importing Ushahidi V2 Sep 10, 2020
@tuxpiper
Copy link
Member Author

For the moment, targeting this as a fix to roll with the v2->v3 import tool (#3418)

@tuxpiper tuxpiper added this to the v2-v3 Migration code release [4.7.0] milestone Sep 10, 2020
@tuxpiper tuxpiper reopened this Sep 10, 2020
@tuxpiper tuxpiper modified the milestones: v2-v3 Migration code release [4.7.0], Next minor release May 31, 2021
@tuxpiper tuxpiper removed this from the Next minor release milestone Jun 10, 2021
@tuxpiper tuxpiper added this to Date and Time in Bug packs Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Bug packs
Date and Time
Importing Ushahidi V2
  
In progress
Development

No branches or pull requests

3 participants