transformer_refactoring #44
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Event-Federation/wordpress-activitypub-event-bridge#44
Loading…
Reference in a new issue
No description provided.
Delete branch "transformer_refactoring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
oh i broke post_content of gatherpress. post_content for the other transformers isn't implemented yet
things i changed:
class-events-manager.php
class-gatherpress.php
class-the-events-calendar.php
class-event.php
Thanks for cleaning things up. Really look forward to have this even clearer and more stable :)
@ -128,3 +128,2 @@
*/
protected function extract_excerpt(): ?string {
if ( $this->wp_object->excerpt ) {
protected function get_excerpt(): ?string {
The reason I chose "extract" is because, to better show, that it is not a typical getter function like the others that start with get_, as excerpt is not attribute in the Event object.
@ruru4143 Do you agree? :) Or is extract a too weird wording?
at this small level: i don't care, but maybe we should talk about our naming schema in general (get, format, extract)
@ -275,0 +288,4 @@
// we could override the template here, to get out custom template from an option.
if ( 'event' === $wp_object->post_type ) {
This if should not be necessary, but it does not hurt either. We can keep it, just to be sure.
@ -305,3 +327,3 @@
array(
'https://www.w3.org/ns/activitystreams#Public',
$this->get_actor_object()->get_followers(),
$this->get_actor_object()->get_followers(), // this fails on my machine.
Which Version of the ActivityPub plugin do you use? These function where added in a fix a few months ago.
master branch, 4 commits after tag 3.0.0
master branch is not the most recent, checkout
trunk
.ah i see, i'm not used to update from a upstream, always just pulled from our repro 😅
@ -114,9 +89,6 @@ final class Events_Manager extends Event_Transformer {
if ( $em_location->location_state ) {
$address['addressRegion'] = $em_location->location_state;
}
if ( $em_location->location_postcode ) {
Why did you remove that?
because you already set this in Line 86
WIP: transformer_refactoringto transformer_refactoringSome last thoughts before merging this:
Would you really change the behaviour here? Even if we do a user setting, I would just apply a custom template inherited with the possibilities from the ActivityPub plugin.
Furthermore this is currently not rendering blocks or shortcodes etc.
@ -201,4 +128,1 @@
return $activitypub_object;
}
}
This behaviour was once copied from Mobilizon. The way they handle groups. The actor is the person who created the event and attributedTo is the Group. Mobilizon also had or still has mechanism to not list received events when the attributedTo is of type Person.
For now I removed it in commit #1813a518f308e1570b21bf1894cf7518ed3d5bc1
@ruru4143 The commit
724a884738
took me about 90 minutes to fix. A horrible race-condition that only is relevant in the test-setup!