You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sync Speakers from Eventyay replaces an event's imported schedule with an empty table when the event's Eventyay API URL returns a JSON:API document, for example https://api.eventyay.com/v1/events/<slug>/sessions.
The sync still reports success ("Synced 2 speaker(s) from 2 Eventyay session(s).") and logs PHP Warning: Undefined array key "sessions".
Steps to Reproduce
Open an Eventyay-linked event (one with an Eventyay slug) in the editor and click Sync Speakers from Eventyay in the Eventyay Speaker Sync box.
With no saved API URL the sync uses the organizer REST speakers endpoint, and Event Schedule Sessions now lists the imported sessions.
Set the event's saved Eventyay API URL to a JSON:API sessions URL, e.g. https://api.eventyay.com/v1/events/<slug>/sessions.
The sync handler accepts it as eventyay_api_url, saves it for later syncs and appends include=speakers,track itself.
Click Sync Speakers from Eventyay again and reload the editor.
Measured on main @ 5d08094 (WordPress 7.1, PHP 8.3), driving the editor with Playwright, with the Eventyay responses stubbed locally:
A sync only rewrites the schedule when the Eventyay response actually carries a session list.
A JSON:API response, for which the plugin builds no session list, leaves the imported schedule as it is, and no Undefined array key warning is raised.
Actual Behavior
The imported schedule is overwritten with a header-only table while the sync reports success.
Every later click keeps it empty, because the JSON:API URL stays saved for the event.
Screenshots
issue.webm
Additional Context
Root cause: Wpfaevent_JSONAPI_Parser::normalize_eventyay_payload() returns only speakers and session_count for a JSON:API document (includes/eventyay-importer/class-wpfaevent-jsonapi-parser.php:1699-1702).
REST responses are unaffected, because normalize_eventyay_rest_speakers_payload() always returns a sessions list. Wpfaevent_Eventyay_Ajax_Sync::ajax_sync_eventyay() and ::sync_speakers_for_event() still pass $import['sessions'] to write_eventyay_schedule_table() unconditionally (admin/class-wpfaevent-eventyay-ajax-sync.php:119 and :1108).
The missing key arrives as null, line 1256 turns it into array(), and because the existing schedule's source is eventyay (line 1267) it is replaced.
Manually created schedules are not affected, since that same source check protects them.
sync_speakers_for_event(), used by the import flows, takes the JSON:API path when the import settings have no organizer slug, and loses the schedule the same way (reproduced separately).
The unconditional reads date back to #134 (75dac81).
Building schedule rows from JSON:API session resources would be a separate enhancement; that path has never written schedule rows.
Contribution Checklist
I have searched existing issues to ensure this bug hasn't been reported
I have provided clear reproduction steps
I have included relevant environment details
I have described both expected and actual behavior
Bug Description
Sync Speakers from Eventyay replaces an event's imported schedule with an empty table when the event's Eventyay API URL returns a JSON:API document, for example
https://api.eventyay.com/v1/events/<slug>/sessions.The sync still reports success ("Synced 2 speaker(s) from 2 Eventyay session(s).") and logs
PHP Warning: Undefined array key "sessions".Steps to Reproduce
With no saved API URL the sync uses the organizer REST speakers endpoint, and Event Schedule Sessions now lists the imported sessions.
https://api.eventyay.com/v1/events/<slug>/sessions.The sync handler accepts it as
eventyay_api_url, saves it for later syncs and appendsinclude=speakers,trackitself.Measured on
main@ 5d08094 (WordPress 7.1, PHP 8.3), driving the editor with Playwright, with the Eventyay responses stubbed locally:Expected Behavior
A sync only rewrites the schedule when the Eventyay response actually carries a session list.
A JSON:API response, for which the plugin builds no session list, leaves the imported schedule as it is, and no
Undefined array keywarning is raised.Actual Behavior
The imported schedule is overwritten with a header-only table while the sync reports success.
Every later click keeps it empty, because the JSON:API URL stays saved for the event.
Screenshots
issue.webm
Additional Context
Root cause:
Wpfaevent_JSONAPI_Parser::normalize_eventyay_payload()returns onlyspeakersandsession_countfor a JSON:API document (includes/eventyay-importer/class-wpfaevent-jsonapi-parser.php:1699-1702).REST responses are unaffected, because
normalize_eventyay_rest_speakers_payload()always returns asessionslist.Wpfaevent_Eventyay_Ajax_Sync::ajax_sync_eventyay()and::sync_speakers_for_event()still pass$import['sessions']towrite_eventyay_schedule_table()unconditionally (admin/class-wpfaevent-eventyay-ajax-sync.php:119and:1108).The missing key arrives as
null, line 1256 turns it intoarray(), and because the existing schedule'ssourceiseventyay(line 1267) it is replaced.Manually created schedules are not affected, since that same
sourcecheck protects them.sync_speakers_for_event(), used by the import flows, takes the JSON:API path when the import settings have no organizer slug, and loses the schedule the same way (reproduced separately).The unconditional reads date back to #134 (75dac81).
Building schedule rows from JSON:API session resources would be a separate enhancement; that path has never written schedule rows.
Contribution Checklist