[Bug 42825] New: ERM Local Title - Start date (started_on) not saved for package resources
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 Bug ID: 42825 Summary: ERM Local Title - Start date (started_on) not saved for package resources Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: ERM Assignee: jonathan.druart@gmail.com Reporter: adolfo.rodriguez@xercode.es QA Contact: testopia@bugs.koha-community.org CC: jonathan.druart@gmail.com, jonathan.field@openfifth.co.uk, martin.renvoize@openfifth.co.uk, matt.blenkinsop@openfifth.co.uk, pedro.amorim@openfifth.co.uk Target Milestone: --- When editing a local ERM Title and linking it to a package, the Start date (started_on) field is not saved — it remains empty after saving and reopening the record. The End date (ended_on) and Proxy fields save correctly. Steps to reproduce: 1 Go to ERM > eHoldings > Local > Titles 2 Create or edit a local title 3 Link it to at least one package and enter a Start date (and optionally an End date and Proxy) 4 Save 5 Reopen the title — Start date is empty; End date and Proxy are saved correctly The root cause of the error: In koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue, the started_on field inside relationshipFields is missing indexRequired: true. This property causes the form system to generate a unique DOM id per row (e.g. started_on_0) and passes the row index to the component. Without it, the id stays as started_on, breaking the reactive binding between the flatpickr input and the Vue data model. The ended_on field does not have componentProps, so it is not affected. The started_on field does have componentProps.date_to which alters how the component id is expected to be resolved, making it the only field that fails without indexRequired. Additionally, calendar.inc throws a TypeError: Cannot read properties of null (reading '_flatpickr') in the browser console when selecting a start date, because the date_to componentProp references ended_on without the row index suffix. See also: Bug 42536 — while investigating why the Proxy field was not displayed in the resource view, the missing Start date in the edit form was identified as a related but separate issue in the same component (EHoldingsLocalTitleResource.vue). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 --- Comment #1 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 200207 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200207&action=edit Bug 42825: ERM Local Title - Start date (started_on) not saved for package resources To reproduce: 1. Go to ERM > eHoldings > Local > Titles 2. Create or edit a local title 3. Link it to a package and enter a Start date, End date and Proxy 4. Save 5. Reopen the title and click on the linked package row => Start date is empty; End date and Proxy are saved correctly Apply patch, then: 1. Go to ERM > eHoldings > Local > Titles 2. Create or edit a local title 3. Link it to a package and enter a Start date, End date and Proxy 4. Save 5. Reopen the title and click on the linked package row => Start date is now saved and displayed correctly => No TypeError in the browser console when selecting a start date -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200207|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 200304 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200304&action=edit Bug 42825: ERM Local Title - Start date (started_on) not saved for package resources The started_on field inside relationshipFields was missing indexRequired: true, which is required to generate a unique DOM id per row and correctly bind the flatpickr input to the Vue data model. The date_to componentProp also needs indexRequired: true so it references the correct indexed id of the ended_on field. Additionally, add a null check in calendar.inc before accessing ._flatpickr on the end date element to prevent a TypeError when the linked element is not found. To reproduce: 1. Go to ERM > eHoldings > Local > Titles 2. Create or edit a local title 3. Link it to a package and enter a Start date, End date and Proxy 4. Save 5. Reopen the title and click on the linked package row => Start date is empty; End date and Proxy are saved correctly Apply patch, then: 1. Go to ERM > eHoldings > Local > Titles 2. Create or edit a local title 3. Link it to a package and enter a Start date, End date and Proxy 4. Save 5. Reopen the title and click on the linked package row => Start date is now saved and displayed correctly => No TypeError in the browser console when selecting a start date Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes adding a title release notes| |to a package when creating | |a new title for ERM - the | |start date for the title | |was not saved (ERM > | |eHoldings > Titles > New | |title > Packages > Add new | |package). CC| |david@davidnind.com Assignee|jonathan.druart@gmail.com |adolfo.rodriguez@xercode.es --- Comment #3 from David Nind <david@davidnind.com> --- I've changed the assignee 8-). Testing notes (using KTD): 1. After applying the patch: - yarn build - restart_all 2. Note that on the resource information page for the title, that some information is shown with the authorized value code, rather than the description - not related to this bug though: - Publication type: for example, streamingaudio is shown instead of 'Streaming audio' - Package content type: for example, StreamingMedia is shown instead of 'Streaming media' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |paul.derscheid@lmscloud.de |y.org | Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200304|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 --- Comment #4 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 200846 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200846&action=edit Bug 42825: ERM Local Title - Start date (started_on) not saved for package resources The started_on field inside relationshipFields was missing indexRequired: true, which is required to generate a unique DOM id per row and correctly bind the flatpickr input to the Vue data model. The date_to componentProp also needs indexRequired: true so it references the correct indexed id of the ended_on field. Additionally, add a null check in calendar.inc before accessing ._flatpickr on the end date element to prevent a TypeError when the linked element is not found. To reproduce: 1. Go to ERM > eHoldings > Local > Titles 2. Create or edit a local title 3. Link it to a package and enter a Start date, End date and Proxy 4. Save 5. Reopen the title and click on the linked package row => Start date is empty; End date and Proxy are saved correctly Apply patch, then: 1. Go to ERM > eHoldings > Local > Titles 2. Create or edit a local title 3. Link it to a package and enter a Start date, End date and Proxy 4. Save 5. Reopen the title and click on the linked package row => Start date is now saved and displayed correctly => No TypeError in the browser console when selecting a start date Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42825 --- Comment #5 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org