Skip to content

N°9950 - Error loading structural data on upgrade - #1019

Merged
eespie merged 4 commits into
developfrom
issue/9950_-_Error_loading_structural_data_on_upgrade
Aug 21, 2026
Merged

N°9950 - Error loading structural data on upgrade#1019
eespie merged 4 commits into
developfrom
issue/9950_-_Error_loading_structural_data_on_upgrade

Conversation

@eespie

@eespie eespie commented Aug 21, 2026

Copy link
Copy Markdown
Member

Error loading structural data on upgrade when class has been removed

Copilot AI balanced review requested due to automatic review settings August 21, 2026 07:58
@CombodoApplicationsAccount CombodoApplicationsAccount added the internal Work made by Combodo label Aug 21, 2026
@eespie
eespie requested a review from dflaven August 21, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Allows upgrades to continue when historical structural data references a removed class.

Changes:

  • Logs and skips unknown XML classes instead of throwing an exception.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread setup/xmldataloader.class.inc.php Outdated
Comment thread setup/xmldataloader.class.inc.php Outdated
if (!MetaModel::IsValidClass($sClass)) {
SetupLog::Error("Unknown class - $sClass");
throw(new Exception("Unknown class - $sClass"));
continue; // Trying to load non-existing class, ignore it
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR allows structural data loading to continue when XML references a class absent from the compiled model, addressing upgrades where classes were removed.

  • Replaces the unknown-class exception with logging and section skipping.
  • The behavior applies to every XMLDataLoader caller, including interactive backoffice imports.

Confidence Score: 4/5

This PR should not merge until unknown-class tolerance is limited to the intended upgrade scenario or propagated as a failure for other import paths.

The unconditional continue allows the backoffice loader to commit a partial import and explicitly report success because the skipped class is recorded in neither the loader's errors nor warnings.

Files Needing Attention: setup/xmldataloader.class.inc.php

Important Files Changed

Filename Overview
setup/xmldataloader.class.inc.php Broadens unknown-class tolerance to every loader mode, causing non-upgrade imports to commit and report success after silently omitting invalid sections.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[XML input] --> B{Class exists?}
  B -->|Yes| C[Load records]
  B -->|No| D[Log and skip section]
  C --> E[EndSession succeeds]
  D --> E
  E --> F[Commit and report success]
Loading

Reviews (1): Last reviewed commit: "N°9950 - Error loading structural data o..." | Re-trigger Greptile

Comment thread setup/xmldataloader.class.inc.php Outdated
if (!MetaModel::IsValidClass($sClass)) {
SetupLog::Error("Unknown class - $sClass");
throw(new Exception("Unknown class - $sClass"));
continue; // Trying to load non-existing class, ignore it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unknown classes produce successful imports

When an administrator imports XML containing a class unavailable in the current data model, this branch records neither a loader error nor a warning, so the backoffice loader commits the valid sections and reports success while silently omitting every object in the unknown-class section.

Knowledge Base Used: Setup: Install/Upgrade Wizard

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Ok to continue ignoring the error. But maybe the message entry in the log should be an Info or Warning (since it does not break the setup) and the message should be more explicit, something like: "Loading of data for class '$sClass' ignored because the class does not exist."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Error is misleading when we're intentionally continuing. Here's a suggestion using Warning (more appropriate than Info since it's still an unexpected condition worth flagging) with a clearer message:

Suggested change
continue; // Trying to load non-existing class, ignore it
SetupLog::Warning("Loading of data for class '$sClass' ignored because the class does not exist.");
continue; // Trying to load non-existing class, ignore it

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@eespie
eespie requested a review from Molkobain August 21, 2026 08:16
eespie and others added 2 commits August 21, 2026 10:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@eespie
eespie requested a review from odain-cbd August 21, 2026 13:19
@eespie
eespie merged commit 98913a2 into develop Aug 21, 2026
@eespie
eespie deleted the issue/9950_-_Error_loading_structural_data_on_upgrade branch August 21, 2026 13:23
@Molkobain Molkobain added this to the 3.3.0 milestone Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants