m-vo / contao-facebook-import

Facebook posts and events for Contao Open Source CMS
Other
11 stars 5 forks source link

Eventtitle Update on Facebook is not synced #11

Closed chuckki closed 5 years ago

chuckki commented 5 years ago

Hi,

i updated the title on facebook and synced manually on contao. The title is not updated. If i delete the event in my db - the sync creates the correct event with the new title. How do the app decide to update or not update the events in contao?

m-vo commented 5 years ago

This should work I guess.

The update happens in here: https://github.com/m-vo/contao-facebook-import/blob/c1d9cf01a425b5fb811bb23ca5dd65249f2916fd/src/Entity/FacebookEvent.php#L95-L106

Can you please verify that changing any of the other attributes (see above, 'start time', 'ticket url', ...) also does not change the entry in contao? (In this case there is probably something wrong in the synchronizer.)

The log should show how many elements are added/updated/removed. What's in there after the sync?

m-vo commented 5 years ago

Can you please check if Facebook's updated_time property gets updated if you are making changes? You can use the API explorer to verify that:

chuckki commented 5 years ago

I have no direct access to the facebook explorer, but dumped the fields successfully in the backend. I think that you could be right with the guess about the synchronizer. I noticed that following if-statment could not get true and the $update-Array wont be filled. https://github.com/m-vo/contao-facebook-import/blob/c1d9cf01a425b5fb811bb23ca5dd65249f2916fd/src/Synchronization/Synchronizer.php#L77-L79 The callable with parameters is true for my current EventNode, but the first part null === $isUpdateRequired wont get true. I get always the following Object when i dump $isUpdateRequired before the statement:


Closure {#810 ▼
  class: "Mvo\ContaoFacebookImport\Synchronization\EventSynchronizer"
  this: EventSynchronizer {#538 …}
  parameters: {▼
    $event: {▼
      typeHint: "Mvo\ContaoFacebookImport\Entity\FacebookEvent"
    }
    $graphNode: {▼
      typeHint: "Facebook\GraphNodes\GraphNode"
    }
  }
  file: "/Users/thisIsNotRoot/contao/vendor/mvo/contao-facebook-import/src/Synchronization/EventSynchronizer.php"
  line: "94 to 96"
}
m-vo commented 5 years ago

I have no direct access to the facebook explorer,

You should have. It essentially takes the same access token as the extension does.

chuckki commented 5 years ago

Not possible to switch from v3.2 to v3.1, but i got the fields via the explorer (registered me in facebook with grandma´s phone number)

[...] but dumped the fields successfully in the backend.

Maybe its on my side. Btw - thx a lot for the extension, good job!