39 lines
28 KiB
JSON
39 lines
28 KiB
JSON
{
|
|
"schema_version": 1,
|
|
"channel": "homelab-runtime",
|
|
"command_id": "NEWFI-260907-A-PORTAL200-APPLY4FIX1-RCA3",
|
|
"status": "OK",
|
|
"rc": 0,
|
|
"host": "pve01",
|
|
"mode": "read-only",
|
|
"component": "newfi-portal200-template-entity-extension-rca",
|
|
"started_at_utc": "2026-09-07T21:06:36Z",
|
|
"finished_at_utc": "2026-09-07T21:06:54Z",
|
|
"reference_register_checked": true,
|
|
"reference_sha256": "5a3d8e5154c41cb582a4e0aca68090be1f0138918bf82131a948df326f9d8d66",
|
|
"error_register_checked": true,
|
|
"error_register_sha256": "3b09a553ec0f527ed3afeed4753f52a74ee3036045bbfb3c685e9f8af4ba7ba0",
|
|
"command_sha256": "5e33d118a3bd33d5699bdd6c47546962ed682835db85a5d1d686f09c447e7ca6",
|
|
"duplicate_failed_command_blocked": false,
|
|
"block_reason": null,
|
|
"execution_started": true,
|
|
"change_declared": false,
|
|
"result_contract_valid": true,
|
|
"result_contract_status": null,
|
|
"result_contract_error": null,
|
|
"command_rc": 0,
|
|
"changes_made": false,
|
|
"rollback_started": false,
|
|
"rollback_restored": null,
|
|
"mutation_outcome": "NO_MUTATION",
|
|
"sanitized": true,
|
|
"secrets_included": false,
|
|
"private_addresses_included": false,
|
|
"raw_evidence_retained_locally": true,
|
|
"raw_evidence_sha256": "5efbcea43535290cdff835533f3246bd883f2882cf5dfea95912c52d81d5e713",
|
|
"sanitized_output_sha256": "5efbcea43535290cdff835533f3246bd883f2882cf5dfea95912c52d81d5e713",
|
|
"output_truncated_in_json": false,
|
|
"full_sanitized_output_url": "https://git.gram1.ru/.well-known/homelab-runtime/latest.txt",
|
|
"output": "RCA3_BEGIN=true\nCOMMAND_ID=NEWFI-260907-A-PORTAL200-APPLY4FIX1-RCA3\nMUTATION_SCOPE=NONE_READ_ONLY\nMUTATIONS_PERFORMED=NO\nERROR_REGISTER_CHECK=OK\nERROR_REGISTER_SHA256=3b09a553ec0f527ed3afeed4753f52a74ee3036045bbfb3c685e9f8af4ba7ba0\nREFERENCE_CHECK=OK\nREFERENCE_SHA256=5a3d8e5154c41cb582a4e0aca68090be1f0138918bf82131a948df326f9d8d66\nAUTHORITY_CHECK_SCOPE=READABILITY_ONLY_INCIDENTS_NOT_CLOSED\nRCA2_HISTORY_SHA256=dec40dc5180ac65be74ae9390af66df175d01b322adf91c2d9be7ec22dc4a8f6\nRCA2_STATUS=OK\nRCA2_FINAL_DECISION=RCA2_COMPLETE_NO_MUTATION_TEMPLATE_IMPORT_CONFLICT_EVIDENCE_READY\nGIT_HEAD={\"err\":\"\",\"out\":\"06bab5acd124e768f70305b3d7eca2f595871890\",\"rc\":0}\nGIT_STATUS={\"err\":\"\",\"out\":\"\",\"rc\":0}\nGIT_REMOTE_HEAD=06bab5acd124e768f70305b3d7eca2f595871890\nBASELINE_XML_STRUCTURE={\"bytes\":1461,\"children\":[{\"attrib\":{\"title\":\"newfi_portal\",\"type\":\"public\",\"version_id\":\"1000010\",\"version_string\":\"1.0.0 Alpha 1\"},\"index\":0,\"tag\":\"template\",\"text_bytes\":1274,\"text_sha256\":\"1f484c8cf6bdeda8fda2974abf8a57f8cc7453fe2a779af7c735afa3b73aa741\"}],\"root_attrib\":{},\"root_tag\":\"templates\",\"sha256\":\"c29c04f8b937284e821c87957653e87c2f6ac014fac30648a0f6b18e84392adf\"}\nCANDIDATE_XML_STRUCTURE={\"bytes\":10977,\"children\":[{\"attrib\":{\"title\":\"newfi_portal\",\"type\":\"public\",\"version_id\":\"1000010\",\"version_string\":\"1.0.0 Alpha 1\"},\"index\":0,\"tag\":\"template\",\"text_bytes\":7027,\"text_sha256\":\"2a7b332223b7fb0af18cfb9659d1698603faa79d5d0f63c49359dd6a1c8fbf7a\"},{\"attrib\":{\"title\":\"newfi_portal.less\",\"type\":\"public\",\"version_id\":\"1000010\",\"version_string\":\"1.0.0 Alpha 1\"},\"index\":1,\"tag\":\"template\",\"text_bytes\":3634,\"text_sha256\":\"25b1dc49e89ef7615a11cd1023876c4ab9b5f96f90b1fca52a4815bb5992fbe8\"}],\"root_attrib\":{},\"root_tag\":\"templates\",\"sha256\":\"1650c3d868d4bc47703f1b75f1f179cd25309b2d3b20a2b848e81a4423c00861\"}\nDB_SCHEMAS=[\"xf_newfi\"]\nCURRENT_TEMPLATE={\"err\":\"\",\"rc\":0,\"rows\":[\"1610\\t0\\tpublic\\tnewfi_portal\\tNewfi/Portal\\t1f484c8cf6bdeda8fda2974abf8a57f8cc7453fe2a779af7c735afa3b73aa741\"]}\nCLASS_EXT_TEMPLATE={\"err\":\"\",\"rc\":0,\"rows\":[]}\nCODE_EVENTS={\"err\":\"--------------\\nSELECT event_id,event_hint,description,addon_id FROM `xf_newfi`.xf_code_event WHERE event_id IN ('entity_pre_save','entity_post_save','entity_structure','entity_post_delete') ORDER BY event_id\\n--------------\\n\\nERROR 1054 (42S22) at line 1: Unknown column 'event_hint' in 'SELECT'\\n\",\"rc\":1,\"rows\":[]}\nCODE_EVENT_LISTENERS={\"err\":\"\",\"rc\":0,\"rows\":[]}\nADDONS_ACTIVE={\"err\":\"\",\"rc\":0,\"rows\":[\"Newfi/Dogs\\tNewfi Dogs\\t1000010\\t1.0.0 Alpha 1\\t1\",\"Newfi/Events\\tNewfi Events\\t1000010\\t1.0.0 Alpha 1\\t1\",\"Newfi/Portal\\tNewfi Portal\\t1000010\\t1.0.0 Alpha 1\\t1\",\"XF\\tXenForo\\t2031270\\t2.3.12\\t1\",\"XFMG\\tXenForo Media Gallery\\t902031170\\t2.3.11\\t1\",\"XFRM\\tXenForo Resource Manager\\t2031170\\t2.3.11\\t1\"]}\nTEMPLATE_DATATYPE_FULL={\"err\":\"\",\"path\":\"/var/www/forums/newfi/public/src/XF/AddOn/DataType/Template.php\",\"rc\":0,\"text\":\" 1\\t<?php\\n 2\\t\\n 3\\tnamespace XF\\\\AddOn\\\\DataType;\\n 4\\t\\n 5\\tuse XF\\\\Behavior\\\\DevOutputWritable;\\n 6\\tuse XF\\\\Mvc\\\\Entity\\\\Entity;\\n 7\\t\\n 8\\tclass Template extends AbstractDataType\\n 9\\t{\\n 10\\t\\tpublic function getShortName()\\n 11\\t\\t{\\n 12\\t\\t\\treturn 'XF:Template';\\n 13\\t\\t}\\n 14\\t\\n 15\\t\\tpublic function getContainerTag()\\n 16\\t\\t{\\n 17\\t\\t\\treturn 'templates';\\n 18\\t\\t}\\n 19\\t\\n 20\\t\\tpublic function getChildTag()\\n 21\\t\\t{\\n 22\\t\\t\\treturn 'template';\\n 23\\t\\t}\\n 24\\t\\n 25\\t\\tpublic function exportAddOnData($addOnId, \\\\DOMElement $container)\\n 26\\t\\t{\\n 27\\t\\t\\t$entries = $this->finder()\\n 28\\t\\t\\t\\t->where('addon_id', $addOnId)\\n 29\\t\\t\\t\\t->where('style_id', 0)\\n 30\\t\\t\\t\\t->order(['type', 'title'])->fetch();\\n 31\\t\\t\\tforeach ($entries AS $entry)\\n 32\\t\\t\\t{\\n 33\\t\\t\\t\\t$node = $container->ownerDocument->createElement($this->getChildTag());\\n 34\\t\\n 35\\t\\t\\t\\t$this->exportMappedAttributes($node, $entry);\\n 36\\t\\t\\t\\t$this->exportCdata($node, $entry->template);\\n 37\\t\\n 38\\t\\t\\t\\t$container->appendChild($node);\\n 39\\t\\t\\t}\\n 40\\t\\n 41\\t\\t\\treturn $entries->count() ? true : false;\\n 42\\t\\t}\\n 43\\t\\n 44\\t\\tpublic function importAddOnData($addOnId, \\\\SimpleXMLElement $container, $start = 0, $maxRunTime = 0)\\n 45\\t\\t{\\n 46\\t\\t\\t$startTime = microtime(true);\\n 47\\t\\n 48\\t\\t\\t$entries = $this->getEntries($container, $start);\\n 49\\t\\t\\tif (!$entries)\\n 50\\t\\t\\t{\\n 51\\t\\t\\t\\treturn false;\\n 52\\t\\t\\t}\\n 53\\t\\n 54\\t\\t\\t$conditions = [];\\n 55\\t\\t\\tforeach ($entries AS $entry)\\n 56\\t\\t\\t{\\n 57\\t\\t\\t\\t$conditions[] = [\\n 58\\t\\t\\t\\t\\t'type' => (string) $entry['type'],\\n 59\\t\\t\\t\\t\\t'title' => (string) $entry['title'],\\n 60\\t\\t\\t\\t];\\n 61\\t\\t\\t}\\n 62\\t\\t\\tif ($conditions)\\n 63\\t\\t\\t{\\n 64\\t\\t\\t\\t$existing = $this->finder()\\n 65\\t\\t\\t\\t\\t->whereOr($conditions)\\n 66\\t\\t\\t\\t\\t->where('style_id', 0)\\n 67\\t\\t\\t\\t\\t->fetch()\\n 68\\t\\t\\t\\t\\t->groupBy('type', 'title');\\n 69\\t\\t\\t}\\n 70\\t\\t\\telse\\n 71\\t\\t\\t{\\n 72\\t\\t\\t\\t$existing = [];\\n 73\\t\\t\\t}\\n 74\\t\\n 75\\t\\t\\t$i = 0;\\n 76\\t\\t\\t$last = 0;\\n 77\\t\\n 78\\t\\t\\tforeach ($entries AS $entry)\\n 79\\t\\t\\t{\\n 80\\t\\t\\t\\t$i++;\\n 81\\t\\n 82\\t\\t\\t\\tif ($i <= $start)\\n 83\\t\\t\\t\\t{\\n 84\\t\\t\\t\\t\\tcontinue;\\n 85\\t\\t\\t\\t}\\n 86\\t\\n 87\\t\\t\\t\\t$type = (string) $entry['type'];\\n 88\\t\\t\\t\\t$title = (string) $entry['title'];\\n 89\\t\\t\\t\\t$entity = $existing[$type][$title] ?? $this->create();\\n 90\\t\\t\\t\\t$entity->setOption('check_duplicate', false);\\n 91\\t\\t\\t\\t$entity->setOption('report_modification_errors', false);\\n 92\\t\\t\\t\\t$entity->getBehavior(DevOutputWritable::class)->setOption('write_dev_output', false);\\n 93\\t\\n 94\\t\\t\\t\\t$this->importMappedAttributes($entry, $entity);\\n 95\\t\\t\\t\\t$entity->style_id = 0;\\n 96\\t\\t\\t\\t$entity->template = $this->getCdataValue($entry);\\n 97\\t\\t\\t\\t$entity->addon_id = $addOnId;\\n 98\\t\\t\\t\\t$entity->save(true, false);\\n 99\\t\\n 100\\t\\t\\t\\t\\\\XF::dequeueRunOnce('styleLastModifiedDate');\\n 101\\t\\n 102\\t\\t\\t\\tif ($this->resume($maxRunTime, $startTime))\\n 103\\t\\t\\t\\t{\\n 104\\t\\t\\t\\t\\t$last = $i;\\n 105\\t\\t\\t\\t\\tbreak;\\n 106\\t\\t\\t\\t}\\n 107\\t\\t\\t}\\n 108\\t\\t\\treturn ($last ?: false);\\n 109\\t\\t}\\n 110\\t\\n 111\\t\\tpublic function deleteOrphanedAddOnData($addOnId, \\\\SimpleXMLElement $container)\\n 112\\t\\t{\\n 113\\t\\t\\t$existing = $this->findAllForType($addOnId)->where('style_id', 0)->fetch()->groupBy('type', 'title');\\n 114\\t\\t\\tif (!$existing)\\n 115\\t\\t\\t{\\n 116\\t\\t\\t\\treturn;\\n 117\\t\\t\\t}\\n 118\\t\\n 119\\t\\t\\t$entries = $this->getEntries($container) ?: [];\\n 120\\t\\n 121\\t\\t\\tforeach ($entries AS $entry)\\n 122\\t\\t\\t{\\n 123\\t\\t\\t\\t// this approach is used to workaround what appears to be a potential PHP 7.3 bug\\n 124\\t\\t\\t\\t$attributes = $this->getSimpleAttributes($entry);\\n 125\\t\\t\\t\\t$type = $attributes['type'];\\n 126\\t\\t\\t\\t$title = $attributes['title'];\\n 127\\t\\n 128\\t\\t\\t\\tif (isset($existing[$type][$title]))\\n 129\\t\\t\\t\\t{\\n 130\\t\\t\\t\\t\\tunset($existing[$type][$title]);\\n 131\\t\\t\\t\\t}\\n 132\\t\\t\\t}\\n 133\\t\\n 134\\t\\t\\tarray_walk_recursive($existing, function ($entity)\\n 135\\t\\t\\t{\\n\"}\nABSTRACT_DATATYPE_IMPORT={\"err\":\"\",\"path\":\"/var/www/forums/newfi/public/src/XF/AddOn/DataType/AbstractDataType.php\",\"rc\":0,\"text\":\" 180\\t\\t{\\n 181\\t\\t\\treturn [];\\n 182\\t\\t}\\n 183\\t\\n 184\\t\\tprotected function exportArrayToAttributes(\\\\DOMElement $tag, $attr, Entity $entity)\\n 185\\t\\t{\\n 186\\t\\t\\tforeach ($entity->$attr AS $key => $value)\\n 187\\t\\t\\t{\\n 188\\t\\t\\t\\tif ($value === '')\\n 189\\t\\t\\t\\t{\\n 190\\t\\t\\t\\t\\tcontinue;\\n 191\\t\\t\\t\\t}\\n 192\\t\\t\\t\\tif (is_bool($value))\\n 193\\t\\t\\t\\t{\\n 194\\t\\t\\t\\t\\t$value = $value ? 1 : 0;\\n 195\\t\\t\\t\\t}\\n 196\\t\\t\\t\\t$tag->setAttribute($attr . '_' . $key, $value);\\n 197\\t\\t\\t}\\n 198\\t\\t}\\n 199\\t\\n 200\\t\\tprotected function exportCdataToNewNode(\\\\DOMElement $tag, $attr, Entity $entity)\\n 201\\t\\t{\\n 202\\t\\t\\t$newNode = $tag->ownerDocument->createElement($attr);\\n 203\\t\\t\\t$this->exportCdata($newNode, $entity->{$attr});\\n 204\\t\\t\\t$tag->appendChild($newNode);\\n 205\\t\\t}\\n 206\\t\\n 207\\t\\tprotected function exportMappedAttributes(\\\\DOMElement $tag, Entity $entity)\\n 208\\t\\t{\\n 209\\t\\t\\tforeach ($this->getMappedAttributes() AS $attr)\\n 210\\t\\t\\t{\\n 211\\t\\t\\t\\t$value = $entity->getValue($attr);\\n 212\\t\\n 213\\t\\t\\t\\tif ($value !== '')\\n 214\\t\\t\\t\\t{\\n 215\\t\\t\\t\\t\\tif (is_bool($value))\\n 216\\t\\t\\t\\t\\t{\\n 217\\t\\t\\t\\t\\t\\t$value = $value ? 1 : 0;\\n 218\\t\\t\\t\\t\\t}\\n 219\\t\\n 220\\t\\t\\t\\t\\t// CURRENTLY NOT USED DUE TO BC ISSUES WITH 2.0.x < 2.0.4\\n 221\\t\\t\\t\\t\\tif (self::USE_AUTO_CDATA && is_string($value) && !preg_match('/^[^<>&\\\"]*$/si', $value))\\n 222\\t\\t\\t\\t\\t{\\n 223\\t\\t\\t\\t\\t\\t// This exports CDATA, but does not escape `]]>` like \\\\XF\\\\Util\\\\XML::createDomCdataSection(),\\n 224\\t\\t\\t\\t\\t\\t// because it needs to be transparently importable.\\n 225\\t\\t\\t\\t\\t\\t// If you need to export values containing `]]>`, use exportCdataToNewNode()\\n 226\\t\\t\\t\\t\\t\\t// and remove this attribute from exportMappedAttributes()\\n 227\\t\\n 228\\t\\t\\t\\t\\t\\t$newNode = $tag->ownerDocument->createElement($attr);\\n 229\\t\\n 230\\t\\t\\t\\t\\t\\t$newNode->appendChild(\\n 231\\t\\t\\t\\t\\t\\t\\t$newNode->ownerDocument->createCDATASection($entity->{$attr})\\n 232\\t\\t\\t\\t\\t\\t);\\n 233\\t\\n 234\\t\\t\\t\\t\\t\\t$tag->appendChild($newNode);\\n 235\\t\\t\\t\\t\\t}\\n 236\\t\\t\\t\\t\\telse\\n 237\\t\\t\\t\\t\\t{\\n 238\\t\\t\\t\\t\\t\\t$tag->setAttribute($attr, $value);\\n 239\\t\\t\\t\\t\\t}\\n 240\\t\\t\\t\\t}\\n 241\\t\\t\\t}\\n 242\\t\\t}\\n 243\\t\\n 244\\t\\tprotected function importMappedAttributes(\\\\SimpleXMLElement $el, Entity $entity, $allowMaintained = true)\\n 245\\t\\t{\\n 246\\t\\t\\tif ($entity->exists() && $allowMaintained)\\n 247\\t\\t\\t{\\n 248\\t\\t\\t\\t$maintained = $this->getMaintainedAttributes();\\n 249\\t\\t\\t}\\n 250\\t\\t\\telse\\n 251\\t\\t\\t{\\n 252\\t\\t\\t\\t$maintained = [];\\n 253\\t\\t\\t}\\n 254\\t\\n 255\\t\\t\\tforeach ($this->getMappedAttributes() AS $attr)\\n 256\\t\\t\\t{\\n 257\\t\\t\\t\\tif (in_array($attr, $maintained))\\n 258\\t\\t\\t\\t{\\n 259\\t\\t\\t\\t\\tcontinue;\\n 260\\t\\t\\t\\t}\\n 261\\t\\n 262\\t\\t\\t\\tif (self::USE_AUTO_CDATA)\\n 263\\t\\t\\t\\t{\\n 264\\t\\t\\t\\t\\tif (isset($el[$attr]))\\n 265\\t\\t\\t\\t\\t{\\n 266\\t\\t\\t\\t\\t\\t$entity->$attr = (string) $el[$attr];\\n 267\\t\\t\\t\\t\\t}\\n 268\\t\\t\\t\\t\\telse if (isset($el->{$attr}))\\n 269\\t\\t\\t\\t\\t{\\n 270\\t\\t\\t\\t\\t\\t$entity->$attr = (string) $el->{$attr};\\n 271\\t\\t\\t\\t\\t}\\n 272\\t\\t\\t\\t}\\n 273\\t\\t\\t\\telse\\n 274\\t\\t\\t\\t{\\n 275\\t\\t\\t\\t\\t$entity->$attr = (string) $el[$attr];\\n 276\\t\\t\\t\\t}\\n 277\\t\\t\\t}\\n 278\\t\\t}\\n 279\\t\\n 280\\t\\tprotected function pluckXmlAttribute(\\\\SimpleXMLElement $els, $key)\\n 281\\t\\t{\\n 282\\t\\t\\t$values = [];\\n 283\\t\\t\\t$i = 0;\\n 284\\t\\t\\tforeach ($els AS $el)\\n 285\\t\\t\\t{\\n 286\\t\\t\\t\\t$values[$i++] = (string) $el[$key];\\n 287\\t\\t\\t}\\n 288\\t\\n 289\\t\\t\\treturn $values;\\n 290\\t\\t}\\n 291\\t\\n 292\\t\\tprotected function getSimpleAttributes(\\\\SimpleXMLElement $el)\\n 293\\t\\t{\\n 294\\t\\t\\t$output = [];\\n 295\\t\\t\\tforeach ($el->attributes() AS $key => $val)\\n 296\\t\\t\\t{\\n 297\\t\\t\\t\\t$output[$key] = (string) $val;\\n 298\\t\\t\\t}\\n 299\\t\\t\\treturn $output;\\n 300\\t\\t}\\n\"}\nENTITY_TEMPLATE_VERIFY={\"err\":\"\",\"path\":\"/var/www/forums/newfi/public/src/XF/Entity/Template.php\",\"rc\":0,\"text\":\" 1\\t<?php\\n 2\\t\\n 3\\tnamespace XF\\\\Entity;\\n 4\\t\\n 5\\tuse XF\\\\Finder\\\\TemplateFinder;\\n 6\\tuse XF\\\\Finder\\\\TemplateMapFinder;\\n 7\\tuse XF\\\\Mvc\\\\Entity\\\\AbstractCollection;\\n 8\\tuse XF\\\\Mvc\\\\Entity\\\\Entity;\\n 9\\tuse XF\\\\Mvc\\\\Entity\\\\Structure;\\n 10\\tuse XF\\\\Repository\\\\AddOnRepository;\\n 11\\tuse XF\\\\Repository\\\\IconRepository;\\n 12\\tuse XF\\\\Repository\\\\StyleRepository;\\n 13\\tuse XF\\\\Repository\\\\TemplateModificationRepository;\\n 14\\tuse XF\\\\Repository\\\\TemplateRepository;\\n 15\\tuse XF\\\\Service\\\\Template\\\\CompileService;\\n 16\\tuse XF\\\\Service\\\\Template\\\\RebuildService;\\n 17\\tuse XF\\\\Template\\\\Compiler\\\\Ast;\\n 18\\tuse XF\\\\Template\\\\Compiler\\\\Exception;\\n 19\\t\\n 20\\tuse function is_array, is_int, strval;\\n 21\\t\\n 22\\t/**\\n 23\\t * COLUMNS\\n 24\\t * @property int|null $template_id\\n 25\\t * @property string $type\\n 26\\t * @property string $title\\n 27\\t * @property int $style_id\\n 28\\t * @property string $template\\n 29\\t * @property array|bool $template_parsed\\n 30\\t * @property string $addon_id\\n 31\\t * @property int $version_id\\n 32\\t * @property string $version_string\\n 33\\t * @property int $last_edit_date\\n 34\\t *\\n 35\\t * GETTERS\\n 36\\t * @property-read string $combined_title\\n 37\\t * @property-read array $phrasesUsed\\n 38\\t * @property-read Style $Style\\n 39\\t * @property-read Template|null $ParentTemplate\\n 40\\t *\\n 41\\t * RELATIONS\\n 42\\t * @property-read AddOn|null $AddOn\\n 43\\t * @property-read AbstractCollection<TemplateHistory> $History\\n 44\\t * @property-read Style|null $Style_\\n 45\\t */\\n 46\\tclass Template extends Entity\\n 47\\t{\\n 48\\t\\tprotected $modificationStatuses = null;\\n 49\\t\\n 50\\t\\t/**\\n 51\\t\\t * @return string\\n 52\\t\\t */\\n 53\\t\\tpublic function getCombinedTitle()\\n 54\\t\\t{\\n 55\\t\\t\\treturn \\\"{$this->type}:{$this->title}\\\";\\n 56\\t\\t}\\n 57\\t\\n 58\\t\\t/**\\n 59\\t\\t * @return Style\\n 60\\t\\t */\\n 61\\t\\tpublic function getStyle()\\n 62\\t\\t{\\n 63\\t\\t\\tif ($this->style_id == 0)\\n 64\\t\\t\\t{\\n 65\\t\\t\\t\\treturn $this->getStyleRepo()->getMasterStyle();\\n 66\\t\\t\\t}\\n 67\\t\\t\\telse\\n 68\\t\\t\\t{\\n 69\\t\\t\\t\\treturn $this->getRelation('Style');\\n 70\\t\\t\\t}\\n 71\\t\\t}\\n 72\\t\\n 73\\t\\t/**\\n 74\\t\\t * @return Template|null\\n 75\\t\\t */\\n 76\\t\\tpublic function getParentTemplate()\\n 77\\t\\t{\\n 78\\t\\t\\tif (!$this->style_id)\\n 79\\t\\t\\t{\\n 80\\t\\t\\t\\treturn null;\\n 81\\t\\t\\t}\\n 82\\t\\n 83\\t\\t\\t$style = $this->Style;\\n 84\\t\\t\\tif (!$style)\\n 85\\t\\t\\t{\\n 86\\t\\t\\t\\treturn null;\\n 87\\t\\t\\t}\\n 88\\t\\n 89\\t\\t\\t$templateMap = $this->finder(TemplateMapFinder::class)\\n 90\\t\\t\\t\\t->where([\\n 91\\t\\t\\t\\t\\t'style_id' => $style->parent_id,\\n 92\\t\\t\\t\\t\\t'type' => $this->type,\\n 93\\t\\t\\t\\t\\t'title' => $this->title,\\n 94\\t\\t\\t\\t])\\n 95\\t\\t\\t\\t->with('Template', true)\\n 96\\t\\t\\t\\t->with('Template.Style', false)\\n 97\\t\\t\\t\\t->fetchOne();\\n 98\\t\\t\\tif (!$templateMap)\\n 99\\t\\t\\t{\\n 100\\t\\t\\t\\treturn null;\\n 101\\t\\t\\t}\\n 102\\t\\n 103\\t\\t\\treturn $templateMap->Template;\\n 104\\t\\t}\\n 105\\t\\n 106\\t\\tpublic function getAbstractedCompiledTemplatePath($languageId, $styleId, $new = true)\\n 107\\t\\t{\\n 108\\t\\t\\t$title = $new ? $this->getValue('title') : $this->getExistingValue('title');\\n 109\\t\\t\\t$type = $new ? $this->getValue('type') : $this->getExistingValue('type');\\n 110\\t\\n 111\\t\\t\\treturn 'code-cache://templates/l' . $languageId . '/s' . $styleId . '/' . $type . '/' . $title . '.php';\\n 112\\t\\t}\\n 113\\t\\n 114\\t\\tpublic function getHash()\\n 115\\t\\t{\\n 116\\t\\t\\t$contents = str_replace(\\\"\\\\r\\\", '', $this->template);\\n 117\\t\\t\\treturn md5($contents);\\n 118\\t\\t}\\n 119\\t\\n 120\\t\\t/**\\n 121\\t\\t * @return array\\n 122\\t\\t */\\n 123\\t\\tpublic function getPhrasesUsed()\\n 124\\t\\t{\\n 125\\t\\t\\treturn $this->db()->fetchAllColumn(\\\"\\n 126\\t\\t\\t\\tSELECT phrase_title\\n 127\\t\\t\\t\\tFROM xf_template_phrase\\n 128\\t\\t\\t\\tWHERE template_id = ?\\n 129\\t\\t\\t\\\", $this->template_id);\\n 130\\t\\t}\\n 131\\t\\n 132\\t\\tpublic function reparseTemplate($forceValid = false, &$error = null)\\n 133\\t\\t{\\n 134\\t\\t\\t$valid = $this->validateTemplateText($this->template, $forceValid, $ast, $error);\\n 135\\t\\t\\tif ($valid && $ast != $this->template_parsed)\\n 136\\t\\t\\t{\\n 137\\t\\t\\t\\t$this->template_parsed = $ast;\\n 138\\t\\t\\t\\treturn true;\\n 139\\t\\t\\t}\\n 140\\t\\t\\tif (!$valid)\\n 141\\t\\t\\t{\\n 142\\t\\t\\t\\t$this->error($error, 'template');\\n 143\\t\\t\\t\\treturn true;\\n 144\\t\\t\\t}\\n 145\\t\\n 146\\t\\t\\treturn false;\\n 147\\t\\t}\\n 148\\t\\n 149\\t\\tpublic function setTemplateUnchecked($template)\\n 150\\t\\t{\\n 151\\t\\t\\t$template = strval($template);\\n 152\\t\\t\\t$this->_setInternal('template', $template);\\n 153\\t\\t\\t$this->validateTemplateText($template, true, $ast);\\n 154\\t\\n 155\\t\\t\\t$this->template_parsed = $ast;\\n 156\\t\\n 157\\t\\t\\treturn true;\\n 158\\t\\t}\\n 159\\t\\n 160\\t\\tprotected function verifyTitle($title)\\n 161\\t\\t{\\n 162\\t\\t\\tif (substr($title, 0, 1) == '.' || strpos($title, '..') !== false)\\n 163\\t\\t\\t{\\n 164\\t\\t\\t\\t$this->error(\\\\XF::phrase('please_enter_title_using_only_alphanumeric_dot'), 'title');\\n 165\\t\\t\\t\\treturn false;\\n 166\\t\\t\\t}\\n 167\\t\\n 168\\t\\t\\tif (preg_match('/\\\\.html$/i', $title))\\n 169\\t\\t\\t{\\n 170\\t\\t\\t\\t$this->error(\\\\XF::phrase('template_titles_may_not_end_in_html'), 'title');\\n 171\\t\\t\\t\\treturn false;\\n 172\\t\\t\\t}\\n 173\\t\\n 174\\t\\t\\treturn true;\\n 175\\t\\t}\\n 176\\t\\n 177\\t\\tprotected function verifyTemplate($template)\\n 178\\t\\t{\\n 179\\t\\t\\t$valid = $this->validateTemplateText($template, false, $ast, $error);\\n 180\\t\\t\\tif (!$valid)\\n 181\\t\\t\\t{\\n 182\\t\\t\\t\\t$this->error($error, 'template');\\n 183\\t\\t\\t\\treturn false;\\n 184\\t\\t\\t}\\n 185\\t\\n 186\\t\\t\\t$this->template_parsed = $ast;\\n 187\\t\\n 188\\t\\t\\treturn true;\\n 189\\t\\t}\\n 190\\t\\n 191\\t\\tprotected function validateTemplateText($template, $forceValid = false, &$ast = null, &$error = null)\\n 192\\t\\t{\\n 193\\t\\t\\t$compiler = $this->app()->templateCompiler();\\n 194\\t\\n 195\\t\\t\\t$templateModRepo = $this->repository(TemplateModificationRepository::class);\\n 196\\t\\t\\t$templateWithModifications = $templateModRepo->applyModificationsToTemplate(\\n 197\\t\\t\\t\\t$this->type,\\n 198\\t\\t\\t\\t$this->title,\\n 199\\t\\t\\t\\t$template,\\n 200\\t\\t\\t\\t$modificationStatuses\\n 201\\t\\t\\t);\\n 202\\t\\n 203\\t\\t\\t$standardParse = true;\\n 204\\t\\t\\t$error = null;\\n 205\\t\\n 206\\t\\t\\tif ($modificationStatuses)\\n 207\\t\\t\\t{\\n 208\\t\\t\\t\\ttry\\n 209\\t\\t\\t\\t{\\n 210\\t\\t\\t\\t\\t$ast = $compiler->compileToAst($templateWithModifications);\\n 211\\t\\n 212\\t\\t\\t\\t\\tif ($this->getOption('test_compile'))\\n 213\\t\\t\\t\\t\\t{\\n 214\\t\\t\\t\\t\\t\\t$compiler->compileAst($ast);\\n 215\\t\\t\\t\\t\\t}\\n 216\\t\\t\\t\\t\\t$standardParse = false;\\n 217\\t\\t\\t\\t}\\n 218\\t\\t\\t\\tcatch (Exception $e)\\n 219\\t\\t\\t\\t{\\n 220\\t\\t\\t\\t\\t$error = $e->getMessage() . ' - ' . \\\\XF::phrase('template_modifications:') . ' ' . \\\"{$this->type}:{$this->title}\\\";\\n 221\\t\\t\\t\\t\\tforeach ($modificationStatuses AS &$status)\\n 222\\t\\t\\t\\t\\t{\\n 223\\t\\t\\t\\t\\t\\tif (is_int($status))\\n 224\\t\\t\\t\\t\\t\\t{\\n 225\\t\\t\\t\\t\\t\\t\\t$status = 'error_compile';\\n 226\\t\\t\\t\\t\\t\\t}\\n 227\\t\\t\\t\\t\\t}\\n 228\\t\\t\\t\\t}\\n 229\\t\\t\\t}\\n 230\\t\\n 231\\t\\t\\tif ($standardParse)\\n 232\\t\\t\\t{\\n 233\\t\\t\\t\\ttry\\n 234\\t\\t\\t\\t{\\n 235\\t\\t\\t\\t\\t$ast = $compiler->compileToAst($template);\\n 236\\t\\n 237\\t\\t\\t\\t\\tif ($this->getOption('test_compile'))\\n 238\\t\\t\\t\\t\\t{\\n 239\\t\\t\\t\\t\\t\\t$compiler->compileAst($ast);\\n 240\\t\\t\\t\\t\\t}\\n\"}\nENTITY_SET_PENDING={\"err\":\"\",\"path\":\"/var/www/forums/newfi/public/src/XF/Mvc/Entity/Entity.php\",\"rc\":0,\"text\":\" 560\\t\\t{\\n 561\\t\\t\\t$output = [];\\n 562\\t\\t\\tforeach ($this->_structure->columns AS $key => $null)\\n 563\\t\\t\\t{\\n 564\\t\\t\\t\\t$output[$key] = $allowGetters ? $this->get($key) : $this->getValue($key);\\n 565\\t\\t\\t}\\n 566\\t\\n 567\\t\\t\\treturn $output;\\n 568\\t\\t}\\n 569\\t\\n 570\\t\\tfinal public function toApiResult($verbosity = self::VERBOSITY_NORMAL, array $options = [])\\n 571\\t\\t{\\n 572\\t\\t\\t$result = new EntityResult($this);\\n 573\\t\\t\\t$subResult = $this->setupApiResultData($result, $verbosity, $options);\\n 574\\t\\n 575\\t\\t\\tif ($subResult instanceof EntityResultInterface)\\n 576\\t\\t\\t{\\n 577\\t\\t\\t\\treturn $subResult;\\n 578\\t\\t\\t}\\n 579\\t\\t\\telse\\n 580\\t\\t\\t{\\n 581\\t\\t\\t\\treturn $result;\\n 582\\t\\t\\t}\\n 583\\t\\t}\\n 584\\t\\n 585\\t\\tfinal public function toWebhookResult($verbosity = self::VERBOSITY_NORMAL, array $options = [])\\n 586\\t\\t{\\n 587\\t\\t\\t$result = new EntityResult($this, EntityResultInterface::TYPE_WEBHOOK);\\n 588\\t\\t\\t$subResult = $this->setupApiResultData($result, $verbosity, $options);\\n 589\\t\\n 590\\t\\t\\tif ($subResult instanceof EntityResultInterface)\\n 591\\t\\t\\t{\\n 592\\t\\t\\t\\treturn $subResult;\\n 593\\t\\t\\t}\\n 594\\t\\n 595\\t\\t\\treturn $result;\\n 596\\t\\t}\\n 597\\t\\n 598\\t\\t/**\\n 599\\t\\t * This method must be overridden to enable API access to this entity.\\n 600\\t\\t *\\n 601\\t\\t * @param EntityResult $result\\n 602\\t\\t * @param int $verbosity\\n 603\\t\\t * @param array $options\\n 604\\t\\t */\\n 605\\t\\tprotected function setupApiResultData(\\n 606\\t\\t\\tEntityResult $result,\\n 607\\t\\t\\t$verbosity = self::VERBOSITY_NORMAL,\\n 608\\t\\t\\tarray $options = []\\n 609\\t\\t)\\n 610\\t\\t{\\n 611\\t\\t\\tthrow new \\\\LogicException(\\n 612\\t\\t\\t\\t\\\"API result rules not defined by \\\" . $this->_structure->shortName . '. Override setupApiResultData().'\\n 613\\t\\t\\t);\\n 614\\t\\t}\\n 615\\t\\n 616\\t\\tpublic function __set($key, $value)\\n 617\\t\\t{\\n 618\\t\\t\\t$this->set($key, $value);\\n 619\\t\\t}\\n 620\\t\\n 621\\t\\tpublic function offsetSet($key, $value): void\\n 622\\t\\t{\\n 623\\t\\t\\t$this->set($key, $value);\\n 624\\t\\t}\\n 625\\t\\n 626\\t\\tpublic function set($key, $value, array $options = [])\\n 627\\t\\t{\\n 628\\t\\t\\tif ($this->_readOnly)\\n 629\\t\\t\\t{\\n 630\\t\\t\\t\\tthrow new \\\\LogicException(\\\"Entity is read only\\\");\\n 631\\t\\t\\t}\\n 632\\t\\n 633\\t\\t\\tif ($this->_deleted)\\n 634\\t\\t\\t{\\n 635\\t\\t\\t\\tthrow new \\\\LogicException(\\\"Attempted to set '$key' on a deleted entity\\\");\\n 636\\t\\t\\t}\\n 637\\t\\n 638\\t\\t\\tif ($this->_writePending == 'delete')\\n 639\\t\\t\\t{\\n 640\\t\\t\\t\\tthrow new \\\\LogicException(\\\"Attempted to set '$key' while a deletion was pending\\\");\\n 641\\t\\t\\t}\\n 642\\t\\n 643\\t\\t\\tif ($this->_writePending && empty($options['forceSet']))\\n 644\\t\\t\\t{\\n 645\\t\\t\\t\\tthrow new \\\\LogicException(\\\"Attempted to set '$key' while a save was pending without forceSet\\\");\\n 646\\t\\t\\t}\\n 647\\t\\n 648\\t\\t\\tif (!isset($this->_structure->columns[$key]))\\n 649\\t\\t\\t{\\n 650\\t\\t\\t\\tif (empty($options['skipInvalid']))\\n 651\\t\\t\\t\\t{\\n 652\\t\\t\\t\\t\\tthrow new \\\\InvalidArgumentException(\\\"Column '$key' is unknown\\\");\\n 653\\t\\t\\t\\t}\\n 654\\t\\t\\t\\treturn false;\\n 655\\t\\t\\t}\\n 656\\t\\n 657\\t\\t\\t$column = $this->_structure->columns[$key];\\n 658\\t\\n 659\\t\\t\\tif ((!empty($column['readOnly']) || !empty($column['autoIncrement'])) && empty($options['forceSet']))\\n 660\\t\\t\\t{\\n 661\\t\\t\\t\\tif (empty($options['skipInvalid']))\\n 662\\t\\t\\t\\t{\\n 663\\t\\t\\t\\t\\tthrow new \\\\InvalidArgumentException(\\\"Column '$key' is read only, can only be set with forceSet\\\");\\n 664\\t\\t\\t\\t}\\n 665\\t\\t\\t\\treturn false;\\n 666\\t\\t\\t}\\n 667\\t\\n 668\\t\\t\\tif (!empty($column['writeOnce']) && $this->isUpdate() && empty($options['forceSet']))\\n 669\\t\\t\\t{\\n 670\\t\\t\\t\\tif (empty($options['skipInvalid']))\\n 671\\t\\t\\t\\t{\\n 672\\t\\t\\t\\t\\tthrow new \\\\InvalidArgumentException(\\\"Column '$key' can only be written on insert or set with forceSet\\\");\\n 673\\t\\t\\t\\t}\\n 674\\t\\t\\t\\treturn false;\\n 675\\t\\t\\t}\\n 676\\t\\n 677\\t\\t\\tif ($value instanceof DeferredValue)\\n 678\\t\\t\\t{\\n 679\\t\\t\\t\\t$this->_setInternal($key, $value);\\n 680\\t\\t\\t\\treturn true;\\n 681\\t\\t\\t}\\n 682\\t\\n 683\\t\\t\\tif (!$this->_verifyValueCustom($value, $key, $column['type'], $column))\\n 684\\t\\t\\t{\\n 685\\t\\t\\t\\treturn false;\\n 686\\t\\t\\t}\\n 687\\t\\n 688\\t\\t\\t$value = $this->_castValueToType($value, $key, $column['type'], $column);\\n 689\\t\\n 690\\t\\t\\tif (!$this->_em->getValueFormatter()->applyValueConstraints(\\n\"}\nFILESYSTEM_TEMPLATE_EXTENSIONS={\"err\":\"\",\"out\":\"\",\"rc\":0}\nCANDIDATE_TEXT_SIGNALS={\"contains_title_attr\":true,\"contains_type_attr\":true,\"contains_version_id\":true,\"contains_version_string\":true,\"portal200_marker\":true}\nFINAL_DECISION=RCA3_COMPLETE_NO_MUTATION_TEMPLATE_ENTITY_EXTENSION_AND_IMPORT_ORDER_READY\nRCA3_END=true\n"
|
|
}
|