Repository navigation
A List page's linked CardPart FactBox follows the new line as BC does (#8188) - #8190
Conversation
… as fixtures Copies of corpus pull request 1426 (tests/al-language/pages/parts/ListHostFactBoxNewLine.al) and of the reporter's repro: a List page with one CardPart FactBox linked to the key, around the new line. The test that runs them comes with the fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
On a top-level List page opened with OpenEdit, with OnAfterGetRecord only and one CardPart FactBox linked to the one-field key, BC runs the part's OnAfterGetCurrRecord on the blank record at the open of an empty view, at the key's SetValue on the new line and at Next onto it; keeps the part on the row before after New() until the key's SetValue; and runs no OnAfterGetRecord of the host on Next back to the row the line saved. The runner ran none of that. The new module pages/list_factbox_new_line.rs admits only the probe's page shapes and call sequences, through the assumption list-factbox-new-line (corpus pull request 1426); every other shape keeps main's path, and after the New() that kept the part, calls other than a read of the part, the key's SetValue and Close are refused. test_page_op shrank: its cap goes from 276 to 271. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…probe shows none (#8188) Review: the host's reads and property calls (Value, Caption, Editable, ...) after that New() were refused although their answers do not depend on the part; they now run as on main. The key's SetValue took the measured blank-record read for any text that fit the field, a duplicate key included; the candidate key is now converted to the field and must be not blank and the key of no stored row, and the measured call sequence is required. Any other key SetValue lets the part read the new line as main does at New() and goes on as on main. Rust tests compare a host read, a Caption, a duplicate key (also lower case), a blank key and a key after a Caption with main's answers; the refused calls now run in codeunits of their own so a refusal does not hide later tests. The assumption text says what the code checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
The The probe this depends on, aldevtools/BusinessCentral.AL.Language.Tests#1426, is not merged yet. I review it next. Until it is pinned, the passes here stay flagged. |
Corpus pull requests 1426 and 1425 are merged (not pinned yet); the citations already name their lines. docs/codemap.md: keep main's new go_to_key_read_up.rs entry and this branch's pinned_shape.rs entry. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Thanks, Flemming. Corpus PR 1426 is merged. On the branch merged with today's main, both tests of The entry condition is strict and cites the probe line for every fact, which made this easy to review. I found two
Smaller: the texts still say corpus PRs 1425 and 1426 are open. Merging main conflicts in docs/codemap.md. This PR and With those two checks added I will merge it. |
…-line steps Review of #8190 found two facts the entry condition did not check. The probe's field controls carry only ApplicationArea and its table fields no property, yet Editable = false on the host's key control still took the new path, and with a TableRelation on the key the part ran OnAfterGetCurrRecord before the SetValue failed and the steps stayed in HeldRead. factbox_line_pages now also requires field controls of the host and the part with no property but ApplicationArea, a repeater with none, a table with no property but DataClassification and table fields with none (ListHostFactBoxNewLine.al:14, :18-19, :39-42, :74). A SetValue that raises an error sets factbox_line back to Off (factbox_line_after_set_value), so the later calls take main's path. The Rust tests compare each new neighbor with main's log. The assumption text and docs/probes-needed.md follow the narrower shape. docs/codemap.md and the assumption entry go back to LF line endings. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Thanks. Both points are fixed in
The texts say 1425 and 1426 are merged, not pinned yet. The baseline diff on 27, 28 and 29 shows no regression or stale line. |
|
Thanks, Flemming. Both checks are what I asked for. Next I'll check the new commit against my two small apps (Editable = false on "No." and the TableRelation case), and run the baseline diff on the branch merged with main. If both give main's output, I'll land this one. It is the first of the pair to land, so #8187 takes the main merge for |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Thanks, Flemming. Head 9cc3ab7 is the commit I'm landing. It is in a merge train now, together with my checks of your two fixes against my small apps and the baseline diff on 27, 28 and 29. I'll comment here when it is on main. You don't need to merge main into #8187 afterward. Its review is done, and I'll resolve the merge with main ( |
|
Thanks, @FBakkensen. I checked your new commit. With Editable = false on "No." and in the TableRelation case, the branch now gives the same output as main. The baseline diff on BC 27, 28 and 29 shows no regression and no stale line. It landed on main through merge train #8234. #8187 is next. I'll merge main into it in its train, so you don't need to do anything there. |
Fixes #8188
A top-level List page with one CardPart FactBox linked to its key now runs the part's triggers around the new line as Business Central does. Every pass is flagged by the new assumption
list-factbox-new-lineuntil the probe is pinned.What changed
crates/al-vm/src/pages/list_factbox_new_line.rsowns the rule. It admits only the probe's page shapes (factbox_line_pages) and its call sequences (FactboxLine,steps_are). The page shape includes the probe's plain controls and table: field controls with no property but ApplicationArea, a repeater with none, a table with no property but DataClassification, and table fields with none (ListHostFactBoxNewLine.al:14, :18-19, :39-42, :74). In those steps:card_part_blank_on_new_host.Off(factbox_line_after_set_value). The later calls take main's path.test_page_opgoes from 276 to 271.Evidence from real Business Central (required)
tests/al-language/pages/parts/ListHostFactBoxNewLine.al), plus the reporter's repro in A List page's linked CardPart FactBox on the new line: BC keeps the part on the row before after New() and runs its OnAfterGetCurrRecord on the blank line; al-runner blanks the part at New() and runs no part trigger #8188. Probe: CurrPage.Update on a list's new line that the table field's OnValidate inserted (al-runner 8186) BusinessCentral.AL.Language.Tests#1425 (merged, not pinned yet;ListNewLine_PartsHost_*, :713-776) shows the same at the open, at New() and at the moves, on another host shape.Where the behavior is pinned
Not pinned yet. The assumption
list-factbox-new-linecites corpus #1426, anddocs/probes-needed.mdis regenerated.list-factbox-new-line(#1426): partF.AGCR();F.AGCR();F.AGCR();F.AGCR();P.AGRF.AGCR();Shapes that keep today's behavior
issue_8188_neighbors_keep_mainandissue_8188_unmeasured_open_and_rows_keep_maincompare each neighbor's step log with main's (1bd6406; the property cells with 5d12a55). The neighbors are: a host with OnAfterGetCurrRecord, a host trigger that writes Rec, UpdatePropagation, a second part, a Text key, a page extension, Editable = false on the host's key control and on the part's field control, FreezeColumn on the repeater, a Caption on a table field, OpenView, and two rows.issue_8188_key_table_relation_keeps_mainshows that with a TableRelation on the key, the failing SetValue after New() and the later calls read main's log.issue_8188_set_value_error_ends_the_stepsshows that after a SetValue error on the probe's pages the later calls read main's log.issue_8188_calls_after_the_held_new_linereaches the new refusal (Next, the SetValue of another field) and shows that Close keeps main's result.issue_8188_main_reads_after_the_held_new_lineshows main's answers after that New() for a host read and Caption() calls, a duplicate key (also in lower case), a blank key, and a key after a Caption().Checks
issue_8188_list_factbox_follows_the_new_line(red:open=andpartnew=on main; green, flagged)al-test-cli --root . --baseline-diff: on 27, 28 and 29 the head binary has the same counts as main. BC 27.5: 7 regressions in streams and types (Windows code pages). onprem-dotnet: 4 regressions on each major. Both are host differences that main has too. No stale lines../check.sh(not run: Windows machine without bash. Green: fmt, clippy -D warnings, the three ratchets, the al-vm tests, the al-builtins tests and the al-test-cli lib tests, and the 8188 suite tests.al-builtins --test assumption_mergeand the suite's script, WSL, python3 and .NET-host tests need Linux and were not run here)Needs probe, and decisions taken
This branch starts from main, not from #8187: the FactBox rule does not use #8187's code. The host with CardPart FactBoxes in corpus pull request aldevtools/BusinessCentral.AL.Language.Tests#1425 (the
ListNewLine_PartsHost_*tests) needs both changes and stays on main's path in each of them alone; a follow-up joins them once both have landed.