PHP 8.1 + CiviCRM: Compatibility and improvements (funded)
Stiftung Bildung wants to fund some work to avoid problems with recent CiviCRM versions and PHP 8.1 (and higher). Below I summed up some code scans. Some of these results might be false positives. We agreed to not come up with pull requests as we lack deeper knowledge of this extension. They will reach out to you via helpdesk@civicoop.org
ref)
Removed core methods (/CRM/Documents/Form/Searchphp: CRM_Core_Form_Date::buildDateRange($this, 'document_date', 1, '_low', '_high', E::ts('From:'), FALSE);
/CRM/Documents/Upgrader/Basephp: CRM_Core_DAO::executeSql($query, $params);
Some scans (might be some false positives)
+-------------------------------------------------------+---------+--------------------------------------------------------+
| File (Line:Column) | Type | Issue |
+-------------------------------------------------------+---------+--------------------------------------------------------+
| /CRM/Documents/Entity/Document.php (370:22) | removed | Function end() is removed. |
| | | Consider replace with use with objects is deprecated() |
| /CRM/Documents/Entity/Document.php (383:22) | removed | Function end() is removed. |
| | | Consider replace with use with objects is deprecated() |
| /CRM/Documents/Entity/DocumentRepository.php (273:23) | removed | Function reset() is removed. |
| | | Consider replace with use with objects is deprecated() |
| /CRM/Documents/Form/CaseDocuments.php (28:23) | removed | Function reset() is removed. |
| | | Consider replace with use with objects is deprecated() |
| /CRM/Documents/Page/CaseDocuments.php (53:23) | removed | Function reset() is removed. |
| | | Consider replace with use with objects is deprecated() |
+-------------------------------------------------------+---------+--------------------------------------------------------+
PhpStan scan
------ --------------------------------------------------------------------------------------
Line CRM/Documents/DAO/Document.php
------ --------------------------------------------------------------------------------------
84 Access to an undefined property CRM_Documents_DAO_Document::$__table.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line CRM/Documents/DAO/DocumentCase.php
------ --------------------------------------------------------------------------------------
59 Access to an undefined property CRM_Documents_DAO_DocumentCase::$__table.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line CRM/Documents/DAO/DocumentContact.php
------ --------------------------------------------------------------------------------------
59 Access to an undefined property CRM_Documents_DAO_DocumentContact::$__table.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line CRM/Documents/DAO/DocumentEntity.php
------ --------------------------------------------------------------------------------------
66 Access to an undefined property CRM_Documents_DAO_DocumentEntity::$__table.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line CRM/Documents/DAO/DocumentVersion.php
------ --------------------------------------------------------------------------------------
74 Access to an undefined property CRM_Documents_DAO_DocumentVersion::$__table.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line CRM/Documents/Entity/Document.php
------ --------------------------------------------------------------------------------------
127 Function explode invoked with 1 parameter, 2-3 required.
153 Access to an undefined property CRM_Documents_Entity_Document::$case_ids.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
155 Access to an undefined property CRM_Documents_Entity_Document::$case_ids.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
155 Function explode invoked with 1 parameter, 2-3 required.
193 Cannot unset offset *NEVER* on int.
------ --------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------------------------------------------------
Line CRM/Documents/Form/Document.php
------ -------------------------------------------------------------------------------------------------------------------------------------
101 Call to an undefined method CRM_Documents_Form_Document::getSubmitValue().
102 Call to deprecated method preProcess() of class CRM_Custom_Form_CustomData:
see https://github.com/civicrm/civicrm-core/pull/29241 for preferred approach - basically
1) at the tpl layer use CRM/common/customDataBlock.tpl
2) to make the fields available for postProcess
if ($this->isSubmitted()) {
$this->addCustomDataFieldsToForm('FinancialAccount');
}
3) pass getSubmittedValues() to CRM_Core_BAO_CustomField::postProcess($this->getSubmittedValues(), $this->_id, 'FinancialAccount');
to ensure any money or number fields are handled for localisation
204 Call to an undefined method CRM_Documents_Form_Document::exportValue().
205 Call to an undefined method CRM_Documents_Form_Document::exportValue().
206 Call to an undefined method CRM_Documents_Form_Document::exportValue().
271 Access to an undefined property CRM_Documents_Form_Document::$_elements.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ -------------------------------------------------------------------------------------------------------------------------------------
------ ---------------------------------------------------------------------------------------------------------------
Line CRM/Documents/Form/NewVersion.php
------ ---------------------------------------------------------------------------------------------------------------
58 Method CRM_Documents_Form_NewVersion::setDefaultValues() should return array but return statement is missing.
124 Call to an undefined method CRM_Documents_Form_NewVersion::exportValue().
153 Access to an undefined property CRM_Documents_Form_NewVersion::$_elements.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ ---------------------------------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line CRM/Documents/Form/Search.php
------ --------------------------------------------------------------------------------------
51 Call to an undefined method CRM_Documents_Form_Search::getButtonName().
52 Call to an undefined method CRM_Documents_Form_Search::getButtonName().
69 Access to an undefined property CRM_Documents_Form_Search::$_queryParams.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
90 Call to an undefined method CRM_Documents_Form_Search::addElement().
98 Call to an undefined static method CRM_Core_Form_Date::buildDateRange().
156 Access to an undefined property CRM_Documents_Form_Search::$_formValues.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
159 Access to an undefined property CRM_Documents_Form_Search::$_formValues.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
159 Access to an undefined property CRM_Documents_Form_Search::$_queryParams.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
161 Access to an undefined property CRM_Documents_Form_Search::$_formValues.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line CRM/Documents/Selector/Search.php
------ --------------------------------------------------------------------------------------
118 Call to deprecated method getGroupDetail() of class CRM_Core_BAO_CustomGroup:
Legacy function
142 Access to an undefined property CRM_Documents_Selector_Search::$where.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
146 Call to deprecated method value() of class CRM_Utils_Array.
283 Fetching deprecated class constant ROWCOUNT of class CRM_Utils_Pager.
607 Access to an undefined property CRM_Documents_Selector_Search::$_rangeCache.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line CRM/Documents/Upgrader/Base.php
------ --------------------------------------------------------------------------------------
122 Call to an undefined static method CRM_Core_DAO::executeSql().
142 Access to an undefined property CRM_Documents_Upgrader_Base::$queue.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
170 Access to an undefined property CRM_Documents_Upgrader_Base::$queue.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
234 Call to deprecated method setItem() of class CRM_Core_BAO_Setting:
- refer docs https://docs.civicrm.org/dev/en/latest/framework/setting/
------ --------------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------
Line CRM/Documents/Utils/HookInvoker.php
------ ----------------------------------------------------------------------------
30 Access to deprecated static property $_nullObject of class CRM_Utils_Hook.
30 Access to deprecated static property $_nullObject of class CRM_Utils_Hook.
30 Access to deprecated static property $_nullObject of class CRM_Utils_Hook.
30 Access to deprecated static property $_nullObject of class CRM_Utils_Hook.
30 Access to deprecated static property $_nullObject of class CRM_Utils_Hook.
43 Access to deprecated static property $_nullObject of class CRM_Utils_Hook.
43 Access to deprecated static property $_nullObject of class CRM_Utils_Hook.
43 Access to deprecated static property $_nullObject of class CRM_Utils_Hook.
55 Access to deprecated static property $_nullObject of class CRM_Utils_Hook.
------ ----------------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------------------------------------------------------------
Line Civi/CaseArchive/Documents/Entity/CaseDocuments.php
------ -------------------------------------------------------------------------------------------------------------------------------------------------
37 Parameter $entity of method Civi\CaseArchive\Documents\Entity\CaseDocuments::__construct() has invalid type Civi\CaseArchive\Entity\CaseEntity.
48 Parameter $archiveFile of method Civi\CaseArchive\Documents\Entity\CaseDocuments::onPrepare() has invalid type Civi\CaseArchive\ArchiveFile.
56 Instantiated class Civi\CaseArchive\ArchiveFile\SubHtmlFile not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
58 Class Civi\CaseArchive\Documents\Entity\Document does not have a constructor and must be instantiated without any parameters.
------ -------------------------------------------------------------------------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------------------------------------------------------------------
Line Civi/CaseArchive/Documents/Entity/Document.php
------ -----------------------------------------------------------------------------------------------------------------------------------------------
27 Class Civi\CaseArchive\Documents\Entity\Document extends unknown class Civi\CaseArchive\Entity\AbstractEntity.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
44 Call to an undefined method Civi\CaseArchive\Documents\Entity\Document::getEntityId().
63 Parameter $archiveFile of method Civi\CaseArchive\Documents\Entity\Document::onPrepare() has invalid type Civi\CaseArchive\ArchiveFile.
64 Call to an undefined method Civi\CaseArchive\Documents\Entity\Document::getHtmlFile().
65 Access to an undefined property Civi\CaseArchive\Documents\Entity\Document::$htmlFile.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
66 Class Civi\CaseArchive\Documents\Section\DocumentSection does not have a constructor and must be instantiated without any parameters.
67 Access to an undefined property Civi\CaseArchive\Documents\Entity\Document::$customData.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
68 Class Civi\CaseArchive\Documents\Section\DocumentVersionsSection does not have a constructor and must be instantiated without any parameters.
------ -----------------------------------------------------------------------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------------------------------------------------------------------
Line Civi/CaseArchive/Documents/EventListener.php
------ -----------------------------------------------------------------------------------------------------------------------------------------------
32 Parameter $event of method Civi\CaseArchive\Documents\EventListener::onPrepare() has invalid type Civi\CaseArchive\Event\PrepareArchiveEvent.
33 Class Civi\CaseArchive\Entity\CaseEntity not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ -----------------------------------------------------------------------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line Civi/CaseArchive/Documents/Section/CaseDocumentSection.php
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
29 Class Civi\CaseArchive\Documents\Section\CaseDocumentSection extends unknown class Civi\CaseArchive\Section\AbstractSection.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
51 Parameter $entity of method Civi\CaseArchive\Documents\Section\CaseDocumentSection::__construct() has invalid type Civi\CaseArchive\Entity\AbstractEntity.
52 Civi\CaseArchive\Documents\Section\CaseDocumentSection::__construct() calls parent::__construct() but Civi\CaseArchive\Documents\Section\CaseDocumentSection does not extend any class.
82 Parameter $archiveFile of method Civi\CaseArchive\Documents\Section\CaseDocumentSection::onBuild() has invalid type Civi\CaseArchive\ArchiveFile.
83 Access to an undefined property Civi\CaseArchive\Documents\Section\CaseDocumentSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
88 Access to an undefined property Civi\CaseArchive\Documents\Section\CaseDocumentSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
89 Instantiated class Civi\CaseArchive\ArchiveFile\FileAttachment not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
99 Access to an undefined property Civi\CaseArchive\Documents\Section\CaseDocumentSection::$content.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
99 Call to an undefined method Civi\CaseArchive\Documents\Section\CaseDocumentSection::fetchTemplate().
100 Access to an undefined property Civi\CaseArchive\Documents\Section\CaseDocumentSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
101 Access to an undefined property Civi\CaseArchive\Documents\Section\CaseDocumentSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------ -----------------------------------------------------------------------------------------------------------------------------------------------
Line Civi/CaseArchive/Documents/Section/DocumentSection.php
------ -----------------------------------------------------------------------------------------------------------------------------------------------
31 Class Civi\CaseArchive\Documents\Section\DocumentSection extends unknown class Civi\CaseArchive\Section\AbstractSection.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
69 Parameter $archiveFile of method Civi\CaseArchive\Documents\Section\DocumentSection::onBuild() has invalid type Civi\CaseArchive\ArchiveFile.
70 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
74 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
75 Instantiated class Civi\CaseArchive\ArchiveFile\FileAttachment not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
83 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentSection::$content.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
83 Call to an undefined method Civi\CaseArchive\Documents\Section\DocumentSection::fetchTemplate().
84 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
85 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
94 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ -----------------------------------------------------------------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------------------------------------------------------------------
Line Civi/CaseArchive/Documents/Section/DocumentVersionsSection.php
------ -------------------------------------------------------------------------------------------------------------------------------------------------------
30 Class Civi\CaseArchive\Documents\Section\DocumentVersionsSection extends unknown class Civi\CaseArchive\Section\AbstractSection.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
65 Parameter $archiveFile of method Civi\CaseArchive\Documents\Section\DocumentVersionsSection::onBuild() has invalid type Civi\CaseArchive\ArchiveFile.
66 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentVersionsSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
71 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentVersionsSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
72 Instantiated class Civi\CaseArchive\ArchiveFile\FileAttachment not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
87 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentVersionsSection::$content.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
87 Call to an undefined method Civi\CaseArchive\Documents\Section\DocumentVersionsSection::fetchTemplate().
88 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentVersionsSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
89 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentVersionsSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
98 Access to an undefined property Civi\CaseArchive\Documents\Section\DocumentVersionsSection::$entity.
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ -------------------------------------------------------------------------------------------------------------------------------------------------------
------ ---------------------------------------------------------------------------
Line documents.civix.php
------ ---------------------------------------------------------------------------
276 Call to deprecated method mungeCaseType() of class CRM_Case_XMLProcessor.
277 Call to deprecated method mungeCaseType() of class CRM_Case_XMLProcessor.
366 Call to deprecated method value() of class CRM_Utils_Array.
------ ---------------------------------------------------------------------------
------ --------------------------------------------
Line documents.php
------ --------------------------------------------
279 Call to deprecated function civicrm_api().
311 Call to deprecated function civicrm_api().
------ --------------------------------------------
SYSTOPIA reference: 23657