Closed balazscsaba2006 closed 2 years ago
Hi @balazscsaba2006
Thank you for submitting this PR and putting in the effort, highly appreciated. Would it be possible to split this into multiple PR's? As you are actually changing a couple of things here, making reviewing and accepting harder.
Without having actually tested anything, my intial feedback:
The DB prefix addition should already have been applied by Craft automatically (doc). Though I might miss something here.
The fix for redactor fields. Instead of using a specific if case to handle redactor fields with the RichTextStoryChiefFieldType it might be a better idea to change the mapping from string manipulation to a mapping array. I think it will improve readability.
Adding the anyStatus on update and delete event, this change seems valid (though again, haven't actually tested it yet).
Doing a publish when an update event happens and the item wasn't found: I don't think we can accept this change. This would make the plugin behaviour of Craft different to all other integrations. If we would want to do this change we would need to do this accros all our plugins for consistency
Hi @balazscsaba2006
Thank you for submitting this PR and putting in the effort, highly appreciated. Would it be possible to split this into multiple PR's? As you are actually changing a couple of things here, making reviewing and accepting harder.
Without having actually tested anything, my intial feedback:
- The DB prefix addition should already have been applied by Craft automatically (doc). Though I might miss something here.
- The fix for redactor fields. Instead of using a specific if case to handle redactor fields with the RichTextStoryChiefFieldType it might be a better idea to change the mapping from string manipulation to a mapping array. I think it will improve readability.
- Adding the anyStatus on update and delete event, this change seems valid (though again, haven't actually tested it yet).
- Doing a publish when an update event happens and the item wasn't found: I don't think we can accept this change. This would make the plugin behaviour of Craft different to all other integrations. If we would want to do this change we would need to do this accros all our plugins for consistency
@sweet-greg Thank you for the feedback. I'll respond punctually:
Considering we are on the same page for point 1 to 3, I'll focus solely on issue 4. The behaviour of throwing an error is intentional and the most correct one (imo), I'll try to explain. Firstly, it is intended that all Create, update and delete happens through StoryChief, just to indicate this case is an edge-case; Secondly. If, for some reason, someone would remove an article from the CMS directly, they typically would have a good reason for it. Automatically recreating it on update would probably not be desired;
How can you handle that case in the best possible way:
Hi @balazscsaba2006 I've just released v1.0.10 which includes most of your changes:
Thank you for pointing these issues out and providing the PR. The released changes are 99% based on your changes
Hi @balazscsaba2006
I've just released v1.0.10 which includes most of your changes:
Added support for Redactor fields
Fixed the issue with prefixed DB tables
Added AnyStatus criteria on update and delete.
Thank you for pointing these issues out and providing the PR.
The released changes are 99% based on your changes
Thank you @sweet-greg! The release looks good, much appreciated
There are a few queries that don't take into consideration when Craft is installed with prefixed DB tables. This PR fixes these issues.