Update beads metadata

Fix Form_Utils bugs and unify error handling documentation
Protect framework files from auto-modification when not in developer mode

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-03 22:44:48 +00:00
parent 8d92b287be
commit 45cf44edeb
355 changed files with 82 additions and 71 deletions

View File

@@ -107,7 +107,7 @@ class Form_Utils {
// Resolve the promise once all animations are complete
Promise.all(animations).then(() => {
// Scroll to error container if it exists
const $error_container = $parent.find('[data-id="error_container"]').first();
const $error_container = $parent.find('[$sid="error_container"]').first();
if ($error_container.length > 0) {
const container_top = $error_container.offset().top;
@@ -177,8 +177,8 @@ class Form_Utils {
return response;
} catch (error) {
if (error.type === 'form_error' && error.details) {
await Form_Utils.apply_form_errors(form_selector, error.details);
if (error.code === Ajax.ERROR_VALIDATION && error.metadata) {
await Form_Utils.apply_form_errors(form_selector, error.metadata);
} else {
await Form_Utils.apply_form_errors(form_selector, error.message || 'An error occurred');
}
@@ -345,7 +345,7 @@ class Form_Utils {
*/
static _apply_combined_error($parent, summary_msg, unmatched_errors) {
const animations = [];
const $error_container = $parent.find('[data-id="error_container"]').first();
const $error_container = $parent.find('[$sid="error_container"]').first();
const $target = $error_container.length > 0 ? $error_container : $parent;
// Create alert with summary message and bulleted list of unmatched errors
@@ -386,7 +386,7 @@ class Form_Utils {
const animations = [];
// Look for a specific error container div (e.g., in Rsx_Form component)
const $error_container = $parent.find('[data-id="error_container"]').first();
const $error_container = $parent.find('[$sid="error_container"]').first();
const $target = $error_container.length > 0 ? $error_container : $parent;
if (typeof messages === 'string') {

View File

@@ -857,10 +857,10 @@ class Rsx {
<p class="mb-0">${Rsx._escape_html(message)}</p>
</div>
`;
} else if (error.type === 'form_error' && error.details) {
} else if (error.code === Ajax.ERROR_VALIDATION && error.metadata) {
// Validation errors - show unmatched errors only
// (matched errors should be handled by Form_Utils.apply_form_errors)
const errors = error.details;
const errors = error.metadata;
const error_list = [];
for (const field in errors) {