Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[LINST] Add .meta option to skip XIN rules #8714

Merged
merged 1 commit into from
May 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion php/libraries/NDB_BVL_Instrument_LINST.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
// array of the format "field_name" => "group_name"
protected $GroupElements = [];

/**
* Do not require rules by default.
*/
private $skipRules = false;

/**
* Sets up the variables required for a LINST instrument to load
*
Expand Down Expand Up @@ -480,7 +485,9 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
}
$this->formType = 'XIN';

$this->form->addFormRule([&$this, 'XINValidate']);
if (!$this->skipRules) {
$this->form->addFormRule([&$this, 'XINValidate']);
}
$fp = fopen($filename, "r");

// Add elements is only true if we're parsing the current page,
Expand Down Expand Up @@ -926,6 +933,9 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
case 'postmortem':
$this->postMortem = trim($pieces[1]) === 'true';
break;
case 'norules':
$this->skipRules = trim($pieces[1]) === 'true';
break;
default:
break;
}
Expand Down