Closed (fixed)
Project:
Apple News
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Jan 2021 at 18:41 UTC
Updated:
25 May 2021 at 17:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
betoaveigaComment #3
betoaveigaExcuse me. I uploaded the wrong patch on my previous comment. Re-uploading.
Comment #5
m4oliveiI spoke with @BetoAveiga offline about this the other day.
There is clearly a need to extend the functionality the module provides such that you can customize the Apple News format document before it's sent to Apple News. There are currently other means of doing the same thing that this new hook is intended to do via overriding the
\Drupal\applenews\Normalizer\ApplenewsContentEntityNormalizerservice. The nice thing about that is you get access to the\ChapterThree\AppleNewsAPI\Documentobject to use it's API so your not in the business of ensuring the right JSON formatThat approach has it's downsides as well. Namely it's quite verbose.
I think we can arrive at a middle ground by using an event subscriber embedded in the normalizer stack, which will allow subscribers to affect the
\ChapterThree\AppleNewsAPI\Documentobject.We agreed to go that route. I'm currently working on a patch.
Comment #7
m4oliveiOpened a merge request with some foundation. Refactors a bit for better testability and includes a simple test for the normalizer to make sure I didn't break things. This will be good to build the event subscriber onto.
Comment #8
m4oliveiNeeded to rebase against 8.x-1.x. Fingers crossed for green tests.
Comment #10
m4oliveiYay, green! Also I discussed with @BetoAveiga offline, and he's good with the changes.
Merged to 8.x-1.x.