systopia / de.systopia.mailingtools

CiviCRM Extension to support mailings
GNU Affero General Public License v3.0
1 stars 2 forks source link

Upgrade to Civix 22.05.2 extension structure #8

Closed jensschuppe closed 1 year ago

jensschuppe commented 2 years ago

Ran civix upgrade with version 22.05.2 which added mixins and a polyfill for them to be backwards-compatible.

This should fix PHP Deprecated: Array and string offset access syntax with curly braces is deprecated notices.

Please pay special attention to renamed PHPUnit classes in the tests, I could not verify whether that's correct.

Full command output
$ civix upgrade

Incremental upgrades
====================

info.xml does not declare the civix format. Inferred v13.10.0.

Upgrade v13.10.0 => v16.10.0
----------------------------

Executing upgrade script civix/upgrades/16.10.0.up.php
Set civix format to 16.10.0 in info.xml
Write de.systopia.mailingtools/info.xml

Upgrade v16.10.0 => v18.02.0
----------------------------

Executing upgrade script civix/upgrades/18.02.0.up.php
This extension does not implement hook_civicrm_entityTypes, but this is included in newer templates. This is a typical example:

     1: /**
     2:  * Implements hook_civicrm_entityTypes().
     3:  *
     4:  * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes
     5:  */
     6: function mailingtools_civicrm_entityTypes(&$entityTypes) {
     7:   _mailingtools_civix_civicrm_entityTypes($entityTypes);
     8: }

 ! [NOTE] If you use civix to generate custom entities, then you will need this.
 !        Otherwise, it will not be needed.                                     

 ! [NOTE] If you are unsure what to do, you can safely add comment-code.        
 !        Comment-code will not change the behavior. It merely provides an      
 !        example to reference if you encounter issues in the future.           

 Add mailingtools_civicrm_entityTypes? [Yes. Add live-code.]:
  [y] Yes. Add live-code.
  [c] Yes. Add comment-code.
  [n] No. Do not add anything.
 > 

Write de.systopia.mailingtools/mailingtools.php
Set civix format to 18.02.0 in info.xml
Write de.systopia.mailingtools/info.xml

Upgrade v18.02.0 => v19.06.2
----------------------------

Executing upgrade script civix/upgrades/19.06.2.up.php
PHPUnit 6.x+ changed the name of the standard base-class (PHPUnit_Framework_TestCase => PHPUnit\Framework\TestCase).
The file tests/phpunit/api/v3/Mailingtools/EmailsyncTest.php contains at least one reference to the old name.
The upgrader can do an automatic search-replace on this file.

 Perform search/replace? (yes/no) [yes]:
 > 

Write de.systopia.mailingtools/tests/phpunit/api/v3/Mailingtools/EmailsyncTest.php
PHPUnit 6.x+ changed the name of the standard base-class (PHPUnit_Framework_TestCase => PHPUnit\Framework\TestCase).
The file tests/phpunit/api/v3/Mailingtools/MailretentionTest.php contains at least one reference to the old name.
The upgrader can do an automatic search-replace on this file.

 Perform search/replace? (yes/no) [yes]:
 > 

Write de.systopia.mailingtools/tests/phpunit/api/v3/Mailingtools/MailretentionTest.php
Set civix format to 19.06.2 in info.xml
Write de.systopia.mailingtools/info.xml

Upgrade v19.06.2 => v20.06.0
----------------------------

Executing upgrade script civix/upgrades/20.06.0.up.php
phpunit.xml.dist includes obsolete option syntaxCheck="...". Removing it. 
Write de.systopia.mailingtools/phpunit.xml.dist
Set civix format to 20.06.0 in info.xml
Write de.systopia.mailingtools/info.xml

Upgrade v20.06.0 => v22.05.0
----------------------------

Executing upgrade script civix/upgrades/22.05.0.up.php

 ! [NOTE] Civix v22.05 converts several functions to mixins. This reduces       
 !        code-duplication and will enable easier updates in the future.        
 !                                                                              
 !        The upgrader will examine your extension, remove old functions, and   
 !        enable mixins (if needed).                                            
 !                                                                              
 !        The following functions+mixins may be affected:                       
 !                                                                              
 !        1. _*_civix_civicrm_angularModules()        =>  ang-php@1.0.0         
 !        2. _*_civix_civicrm_managed()               =>  mgd-php@1.0.0         
 !        3. _*_civix_civicrm_alterSettingsFolders()  =>  setting-php@1.0.0     
 !        4. _*_civix_civicrm_caseTypes()             =>  case-xml@1.0.0        
 !        5. _*_civix_civicrm_xmlMenu()               =>  menu-xml@1.0.0        
 !        6. _*_civix_civicrm_themes()                =>  theme-php@1.0.0       

 Continue with upgrade? (yes/no) [yes]:
 > 

 ! [NOTE] Skip "ang-php@1.0.0". There are no files matching pattern             
 !        "glob:ang/*.ang.php".                                                 

 ! [NOTE] Skip "mgd-php@1.0.0". There are no files matching pattern             
 !        "find:*.mgd.php".                                                     

 ! [NOTE] Skip "setting-php@1.0.0". There are no files matching pattern         
 !        "glob:settings/*.setting.php".                                        

 ! [NOTE] Skip "case-xml@1.0.0". There are no files matching pattern            
 !        "glob:xml/case/*.xml".                                                

 ! [NOTE] Enable "menu-xml@1.0.0". There are files matching pattern             
 !        "glob:xml/Menu/*.xml".                                                

 ! [NOTE] Skip "theme-php@1.0.0". There are no files matching pattern           
 !        "glob:*.theme.php".                                                   

Enable mixin menu-xml@1.0.0
Write de.systopia.mailingtools/mixin/menu-xml@1.0.0.mixin.php
Write de.systopia.mailingtools/mixin/polyfill.php
Write de.systopia.mailingtools/info.xml
Found reference to obsolete function _mailingtools_civix_civicrm_xmlMenu() at mailingtools.php:21.

    19:  */
    20: function mailingtools_civicrm_xmlMenu(&$files) {
*   21:   _mailingtools_civix_civicrm_xmlMenu($files);
    22: }
    23: 
Removing line mailingtools.php:21

Found reference to obsolete function _mailingtools_civix_civicrm_managed() at mailingtools.php:89.

    87:  */
    88: function mailingtools_civicrm_managed(&$entities) {
*   89:   _mailingtools_civix_civicrm_managed($entities);
    90: }
    91: 
Removing line mailingtools.php:89

Found reference to obsolete function _mailingtools_civix_civicrm_caseTypes() at mailingtools.php:102.

   100:  */
   101: function mailingtools_civicrm_caseTypes(&$caseTypes) {
*  102:   _mailingtools_civix_civicrm_caseTypes($caseTypes);
   103: }
   104: 
Removing line mailingtools.php:102

Found reference to obsolete function _mailingtools_civix_civicrm_angularModules() at mailingtools.php:116.

   114:  */
   115: function mailingtools_civicrm_angularModules(&$angularModules) {
*  116:   _mailingtools_civix_civicrm_angularModules($angularModules);
   117: }
   118: 
Removing line mailingtools.php:116

Found reference to obsolete function _mailingtools_civix_civicrm_alterSettingsFolders() at mailingtools.php:125.

   123:  */
   124: function mailingtools_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
*  125:   _mailingtools_civix_civicrm_alterSettingsFolders($metaDataFolders);
   126: }
   127: 
Removing line mailingtools.php:125

Write de.systopia.mailingtools/mailingtools.php
Set civix format to 22.05.0 in info.xml
Write de.systopia.mailingtools/info.xml

Upgrade v22.05.0 => v22.05.2
----------------------------

Executing upgrade script civix/upgrades/22.05.2.up.php
Set civix format to 22.05.2 in info.xml
Write de.systopia.mailingtools/info.xml

General upgrade
===============

 ! [NOTE] The function "mailingtools_civicrm_xmlMenu()" now appears to be empty.

     1: /**
     2:  * Implements hook_civicrm_xmlMenu().
     3:  *
     4:  * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_xmlMenu
     5:  */
     6: function mailingtools_civicrm_xmlMenu(&$files) {
     7: }
     8: 
     9: 

 Delete the empty function "mailingtools_civicrm_xmlMenu()"? (yes/no) [yes]:
 > 

 ! [NOTE] The function "mailingtools_civicrm_managed()" now appears to be empty.

     1: /**
     2:  * Implements hook_civicrm_managed().
     3:  *
     4:  * Generate a list of entities to create/deactivate/delete when this module
     5:  * is installed, disabled, uninstalled.
     6:  *
     7:  * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed
     8:  */
     9: function mailingtools_civicrm_managed(&$entities) {
    10: }
    11: 
    12: 

 Delete the empty function "mailingtools_civicrm_managed()"? (yes/no) [yes]:
 > 

 ! [NOTE] The function "mailingtools_civicrm_caseTypes()" now appears to be     
 !        empty.                                                                

     1: /**
     2:  * Implements hook_civicrm_caseTypes().
     3:  *
     4:  * Generate a list of case-types.
     5:  *
     6:  * Note: This hook only runs in CiviCRM 4.4+.
     7:  *
     8:  * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_caseTypes
     9:  */
    10: function mailingtools_civicrm_caseTypes(&$caseTypes) {
    11: }
    12: 
    13: 

 Delete the empty function "mailingtools_civicrm_caseTypes()"? (yes/no) [yes]:
 > 

 ! [NOTE] The function "mailingtools_civicrm_angularModules()" now appears to be
 !        empty.                                                                

     1: /**
     2:  * Implements hook_civicrm_angularModules().
     3:  *
     4:  * Generate a list of Angular modules.
     5:  *
     6:  * Note: This hook only runs in CiviCRM 4.5+. It may
     7:  * use features only available in v4.6+.
     8:  *
     9:  * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_angularModules
    10:  */
    11: function mailingtools_civicrm_angularModules(&$angularModules) {
    12: }
    13: 
    14: 

 Delete the empty function "mailingtools_civicrm_angularModules()"? (yes/no) [yes]:
 > 

 ! [NOTE] The function "mailingtools_civicrm_alterSettingsFolders()" now appears
 !        to be empty.                                                          

     1: /**
     2:  * Implements hook_civicrm_alterSettingsFolders().
     3:  *
     4:  * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterSettingsFolders
     5:  */
     6: function mailingtools_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
     7: }
     8: 
     9: 

 Delete the empty function "mailingtools_civicrm_alterSettingsFolders()"? (yes/no) [yes]:
 > 

Write de.systopia.mailingtools/mailingtools.php
Write de.systopia.mailingtools/info.xml
Write de.systopia.mailingtools/mailingtools.civix.php
jofranz commented 1 year ago

Superseded by #9 ?