From f04ab5924d9d9aaf7dcd039cf2110488f2887648 Mon Sep 17 00:00:00 2001 From: 81reap Date: Wed, 28 Oct 2026 17:22:59 -0400 Subject: [PATCH] fix(modal) :: remap `close` to `close_label` `close` is a reserved key word in SQL Server so now the model's label can now also be rewritten with `close_label`. Fixes #1070 Assisted By :: Claude Opus 5.5 --- CHANGELOG.md | 2 ++ examples/official-site/sqlpage/migrations/63_modal.sql | 1 + sqlpage/templates/modal.handlebars | 4 ++-- .../component_rendering/modal_close_label_1070.sql | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 tests/sql_test_files/component_rendering/modal_close_label_1070.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index e44475223..9d55ca615 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - Restored parameter reuse for repeated variables on SQL Server, PostgreSQL, and SQLite, fixing SQL Server and PostgreSQL queries that repeat a variable-dependent expression in `SELECT` and `GROUP BY`. +- The modal component accepts `close_label` as another name for `close`, which is a reserved word on SQL Server. ([#1070](https://github.com/sqlpage/SQLPage/issues/1070)) + ## v0.47.0 (2026-10-15) - Redesigned the official website homepage with live SQLPage examples, an interactive database sculpture, flowing section transitions, responsive layouts, and direct links to documentation and deployment guides. - For sites that store their pages in a database, checking for page updates no longer makes other pages wait when the database is busy. In a test, another page loaded in under 1 ms instead of about 250 ms. diff --git a/examples/official-site/sqlpage/migrations/63_modal.sql b/examples/official-site/sqlpage/migrations/63_modal.sql index 435b71aad..3154007c4 100644 --- a/examples/official-site/sqlpage/migrations/63_modal.sql +++ b/examples/official-site/sqlpage/migrations/63_modal.sql @@ -8,6 +8,7 @@ Modals are closed by default, and can be opened by clicking on a button or link INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'modal', * FROM (VALUES ('title','Description of the modal box.','TEXT',TRUE,FALSE), ('close','The text to display in the Close button.','TEXT',TRUE,TRUE), + ('close_label','The same as `close`. Use it on databases where `close` is a reserved word, such as SQL Server.','TEXT',TRUE,TRUE), ('contents','A paragraph of text to display, without any formatting, without having to make additional queries.','TEXT',FALSE,TRUE), ('contents_md','Rich text in the markdown format. Among others, this allows you to write bold text using `**bold**`, italics using `*italics*`, and links using `[text](https://example.com)`.','TEXT',FALSE,TRUE), ('scrollable','Create a scrollable modal that allows scroll the modal body.','BOOLEAN',TRUE,TRUE), diff --git a/sqlpage/templates/modal.handlebars b/sqlpage/templates/modal.handlebars index c2ce2a763..d82d3e9d6 100644 --- a/sqlpage/templates/modal.handlebars +++ b/sqlpage/templates/modal.handlebars @@ -7,7 +7,7 @@ diff --git a/tests/sql_test_files/component_rendering/modal_close_label_1070.sql b/tests/sql_test_files/component_rendering/modal_close_label_1070.sql new file mode 100644 index 000000000..fa054e9c1 --- /dev/null +++ b/tests/sql_test_files/component_rendering/modal_close_label_1070.sql @@ -0,0 +1 @@ +select 'modal' as component, 'sql_server_safe_close' as id, 'It works !' as close_label;