Skip to content

N°8162 - Issue when synchronizing datasource with read-only notify_contact_id_archive_flag#56

Open
odain-cbd wants to merge 10 commits intomasterfrom
feature/8162-synchro-issue
Open

N°8162 - Issue when synchronizing datasource with read-only notify_contact_id_archive_flag#56
odain-cbd wants to merge 10 commits intomasterfrom
feature/8162-synchro-issue

Conversation

@odain-cbd
Copy link
Contributor

Purpose

Current PR aims at gathering all special attributes at the same place. These attributes should not be taken into account to deal with datasource computation/synchronization.

Symptom

Datasource synchronization may fail with below error due to a regression (PR 32/ N°6115):
[Error] Failed to update the SynchroDataSource 'XXX' (2). Reason: Error: notify_contact_id_archive_flag: Attempting to set the value on the read-only attribute SynchroDataSource::notify_contact_id_archive_flag (100)

Corollary

Datasource computation has been enhanced and related test coverage completed...

@odain-cbd odain-cbd added bug Something isn't working enhancement New feature or request labels Feb 5, 2025
@odain-cbd odain-cbd self-assigned this Feb 5, 2025
@CombodoApplicationsAccount CombodoApplicationsAccount added the internal Work made by Combodo label Feb 5, 2025
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@super-visions.com>
@rquetiez rquetiez self-requested a review July 10, 2025 08:21
Copy link
Contributor

Choose a reason for hiding this comment

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

You can also remove this $sKey variable (as on line 987), it is ambiguous.

@odain-cbd odain-cbd requested review from Hipska and accognet March 16, 2026 14:03
@odain-cbd odain-cbd requested a review from Hipska March 17, 2026 06:51
Copy link
Collaborator

@Hipska Hipska left a comment

Choose a reason for hiding this comment

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

I think I said

Same for all other occurrences of course.

Please also resolve the conflicts, so that can be reviewed as well 😉

unset($aSourceDefinition['notify_contact_id_friendlyname']);
unset($aSourceDefinition['notify_contact_id_finalclass_recall']);
unset($aSourceDefinition['notify_contact_id_obsolescence_flag']);
foreach (Collector::READONLY_FIELDS as $sField){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
foreach (Collector::READONLY_FIELDS as $sField){
foreach (static::READONLY_FIELDS as $sField){

case 'notify_contact_id_archive_flag':
// Ignore all read-only attributes
break;
if (in_array($sKey, Collector::READONLY_FIELDS)){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (in_array($sKey, Collector::READONLY_FIELDS)){
if (in_array($sKey, static::READONLY_FIELDS)){

default:
if (!array_key_exists($sKey, $aDS1)) {
Utils::Log(LOG_DEBUG, "Comparison: Found an extra property '$sKey' in iTop. Data sources differ.");
if (in_array($sKey, Collector::READONLY_FIELDS)){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (in_array($sKey, Collector::READONLY_FIELDS)){
if (in_array($sKey, static::READONLY_FIELDS)){

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants