fix(pres_mgmt): restore Add Person and Save Biography on presenter page
Three regressions in presenter_view.svelte: - update_ae_obj__event_presenter calls for "Add Person" and "Save Biography" were missing event_presentation_id. The function falls back to events_slct.event_presentation_id which is never set on this page, so both calls returned null silently. - "Add Person" confirm dialog showed null for the presenter's name because it referenced person_given_name (the linked person's field, which is null when no person is linked) instead of given_name (the presenter's own field). Also: Re-link person list limit raised to 1000 (matching session POC pattern) and added WHY comment explaining the admin-only re-link restriction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -850,7 +850,11 @@ $effect(() => {
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if $ae_loc.trusted_access && $ae_loc.edit_mode && (!$lq__event_presenter_obj.person_id || $ae_loc.administrator_access)}
|
{#if $ae_loc.trusted_access && $ae_loc.edit_mode && (!$lq__event_presenter_obj.person_id || $ae_loc.administrator_access)}
|
||||||
<!-- Load person list before using the editor's built-in select -->
|
<!-- Load person list before using the editor's built-in select.
|
||||||
|
WHY: Re-linking is intentionally admin-only when a person is already
|
||||||
|
assigned. Staff were creating duplicate person records when they made
|
||||||
|
mistakes on the initial link. The "Add Person" button below serves as
|
||||||
|
the safety net for the first-time case (no person linked yet). -->
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onclick={async () => {
|
onclick={async () => {
|
||||||
@@ -862,8 +866,7 @@ $effect(() => {
|
|||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
for_obj_type: 'account',
|
for_obj_type: 'account',
|
||||||
for_obj_id: $slct.account_id,
|
for_obj_id: $slct.account_id,
|
||||||
limit: $ae_loc.person
|
limit: 1000, // We need to keep this limit high to show all people for selection: $ae_loc.person.qry_limit__people
|
||||||
.qry_limit__people,
|
|
||||||
order_by_li: {
|
order_by_li: {
|
||||||
family_name: 'ASC',
|
family_name: 'ASC',
|
||||||
given_name: 'ASC',
|
given_name: 'ASC',
|
||||||
@@ -970,7 +973,7 @@ $effect(() => {
|
|||||||
if ($ae_loc.administrator_access) {
|
if ($ae_loc.administrator_access) {
|
||||||
if (
|
if (
|
||||||
!confirm(
|
!confirm(
|
||||||
`Add a new person (${$lq__event_presenter_obj.person_given_name}) to the account? You will be able to edit their details after the person record is created.\n\n${$ae_loc.account_name}\nID: ${$slct.account_id}`
|
`Add a new person (${$lq__event_presenter_obj.given_name}) to the account? You will be able to edit their details after the person record is created.\n\n${$ae_loc.account_name}\nID: ${$slct.account_id}`
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
@@ -978,7 +981,7 @@ $effect(() => {
|
|||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
!confirm(
|
!confirm(
|
||||||
`Add a new person (${$lq__event_presenter_obj.person_given_name}) to the account based on this presenter? Be sure to check if there is an existing person record first.\n\n${$ae_loc.account_name}\nID: ${$slct.account_id}`
|
`Add a new person (${$lq__event_presenter_obj.given_name}) to the account based on this presenter? Be sure to check if there is an existing person record first.\n\n${$ae_loc.account_name}\nID: ${$slct.account_id}`
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
@@ -1029,6 +1032,8 @@ $effect(() => {
|
|||||||
if (new_person_obj) {
|
if (new_person_obj) {
|
||||||
events_func.update_ae_obj__event_presenter({
|
events_func.update_ae_obj__event_presenter({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
|
event_presentation_id:
|
||||||
|
$lq__event_presenter_obj?.event_presentation_id,
|
||||||
event_presenter_id:
|
event_presenter_id:
|
||||||
$lq__event_presenter_obj?.event_presenter_id,
|
$lq__event_presenter_obj?.event_presenter_id,
|
||||||
data_kv: {
|
data_kv: {
|
||||||
@@ -1201,6 +1206,8 @@ $effect(() => {
|
|||||||
events_func
|
events_func
|
||||||
.update_ae_obj__event_presenter({
|
.update_ae_obj__event_presenter({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
|
event_presentation_id:
|
||||||
|
$lq__event_presenter_obj?.event_presentation_id,
|
||||||
event_presenter_id:
|
event_presenter_id:
|
||||||
$lq__event_presenter_obj?.event_presenter_id,
|
$lq__event_presenter_obj?.event_presenter_id,
|
||||||
data_kv: event_presenter_data,
|
data_kv: event_presenter_data,
|
||||||
|
|||||||
Reference in New Issue
Block a user