From cb314f6e275201bc8ec438b59523b776a43cf366 Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 18 Oct 2023 19:28:43 -0400 Subject: [PATCH] Extensions - Don't accept invalid keys, include empty in test --- CRM/Extension/Info.php | 3 +++ tests/mock/extension_browser_results/single.json | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Extension/Info.php b/CRM/Extension/Info.php index 9b1b5216ad..6edd859057 100644 --- a/CRM/Extension/Info.php +++ b/CRM/Extension/Info.php @@ -261,6 +261,9 @@ class CRM_Extension_Info { // and deeper into arrays. An exception for URLS section, since // we want them in special format. foreach ($info as $attr => $val) { + if (!property_exists($this, $attr)) { + continue; + } if (!count($val->children())) { $this->$attr = is_array($this->$attr) ? [] : trim((string) $val); } diff --git a/tests/mock/extension_browser_results/single.json b/tests/mock/extension_browser_results/single.json index 0cb12212f1..abb13500af 100644 --- a/tests/mock/extension_browser_results/single.json +++ b/tests/mock/extension_browser_results/single.json @@ -1,12 +1,12 @@ { - "org.civicrm.module.cividiscount": "\n\n cividiscount<\/file>\n CiviDiscount<\/name>\n Enables discount codes and automatic discounts for events and memberships.<\/description>\n \n \n http:\/\/civicrm.org\/extension\/cividiscount-extension\n <\/url>\n \n https:\/\/github.com\/dlobo\/org.civicrm.module.cividiscount\/\n <\/url>\n http:\/\/civicrm.stackexchange.com<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n AGPL-3.0<\/license>\n \n CiviCRM LLC<\/author>\n info@civicrm.org<\/email>\n <\/maintainer>\n 2016-03-04<\/releaseDate>\n 3.2<\/version>\n \n 4.5<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n \n For support, please contact the team on the forums. (http:\/\/forum.civicrm.org)\n <\/comments>\n \n CRM\/CiviDiscount<\/namespace>\n <\/civix>\nhttps:\/\/github.com\/dlobo\/org.civicrm.module.cividiscount\/archive\/3.2.zip<\/downloadUrl>stable<\/develStage><\/extension>\n", + "org.civicrm.module.cividiscount": "\n\n cividiscount<\/file>\n CiviDiscount<\/name>\n Enables discount codes and automatic discounts for events and memberships.<\/description>\n \n \n http:\/\/civicrm.org\/extension\/cividiscount-extension\n <\/url>\n \n https:\/\/github.com\/dlobo\/org.civicrm.module.cividiscount\/\n <\/url>\n http:\/\/civicrm.stackexchange.com<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n AGPL-3.0<\/license>\n \n CiviCRM LLC<\/author>\n info@civicrm.org<\/email>\n <\/maintainer>\n 2016-03-04<\/releaseDate>\n 3.2<\/version>\n \n 4.5<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n \n For support, please contact the team on the forums. (http:\/\/forum.civicrm.org)\n <\/comments>\n \n CRM\/CiviDiscount<\/namespace>\n <\/civix>\nhttps:\/\/github.com\/dlobo\/org.civicrm.module.cividiscount\/archive\/3.2.zip<\/downloadUrl>stable<\/develStage><\/extension>\n", "nz.co.fuzion.extendedreport": "\n\n https:\/\/github.com\/eileenmcnaughton\/nz.co.fuzion.extendedreport\/archive\/2.4.zip<\/downloadUrl>\n extendedreport<\/file>\n ExtendedReport<\/name>\n Extended reports<\/description>\n AGPL<\/license>\n \n http:\/\/civicrm.org<\/url>\n http:\/\/forum.civicrm.org<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n \n Eileen McNaughton<\/author>\n eileen@fuzion.co.nz<\/email>\n <\/maintainer>\n 2016-07-25<\/releaseDate>\n 2.4<\/version>\n stable<\/develStage>\n \n 4.4<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n Extended reports create other report options such as crosstab urls, multiple contact custom fields, price\n set reports\n <\/comments>\n \n CRM\/Extendedreport<\/namespace>\n <\/civix>\n<\/extension>\n", "ca.bidon.reporterror": "\n\n reporterror<\/file>\n CiviCRM Report Error<\/name>\n Advanced error handler for CiviCRM that sends an e-mail with detailed information when fatal errors are encountered.<\/description>\n AGPL 3<\/license>\n \n Mathieu Lutfy<\/author>\n mathieu@bidon.ca<\/email>\n <\/maintainer>\n \n https:\/\/github.com\/mlutfy\/ca.bidon.reporterror<\/url>\n https:\/\/github.com\/mlutfy\/ca.bidon.reporterror\/blob\/master\/README.md<\/url>\n http:\/\/forum.civicrm.org\/index.php\/board,57.0.html<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n 2016-03-06<\/releaseDate>\n 2.9<\/version>\n stable<\/develStage>\n \n 4.2<\/ver>\n 4.3<\/ver>\n 4.4<\/ver>\n 4.5<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n \n \n CRM\/ReportError<\/namespace>\n <\/civix>\nhttps:\/\/github.com\/mlutfy\/ca.bidon.reporterror\/archive\/2.9.zip<\/downloadUrl><\/extension>\n", "org.civicrm.multisite": "\n\n multisite<\/file>\n CiviCRM Multisite<\/name>\n Multisite permissioning for CiviCRM<\/description>\n \n http:\/\/wiki.civicrm.org\/confluence\/pages\/viewpage.action?pageId=86213708<\/url>\n http:\/\/forum.civicrm.org\/index.php\/board,51.0.html<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n AGPL<\/license>\n \n CiviCRM LLC<\/author>\n info@civicrm.org<\/email>\n <\/maintainer>\n 2016-07-25<\/releaseDate>\n 2.5<\/version>\n stable<\/develStage>\n \n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n This is a port of the CiviCRM multisite module to an extension. You will need to review the changes in this version<\/comments>\n \n CRM\/Multisite<\/namespace>\n <\/civix>\nhttps:\/\/github.com\/eileenmcnaughton\/org.civicrm.multisite\/archive\/2.5.zip<\/downloadUrl><\/extension>\n", "org.civicrm.sms.twilio": "\n\n https:\/\/github.com\/civicrm\/org.civicrm.sms.twilio\/archive\/1.1.1.zip<\/downloadUrl>\n twilio<\/file>\n twilio<\/name>\n Twilio integration allows delivering short message service (SMS) messages through its Twilio Gateway to mobile phone users.<\/description>\n \n http:\/\/civicrm.org<\/url>\n http:\/\/wiki.civicrm.org\/confluence\/display\/CRMDOC\/Setting+up+a+SMS+Provider+for+CiviSMS<\/url>\n http:\/\/forum.civicrm.org<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n AGPL<\/license>\n \n Community Contributed<\/author>\n info@civicrm.org<\/email>\n <\/maintainer>\n 2016-06-24<\/releaseDate>\n 1.1.1<\/version>\n stable<\/develStage>\n \n 4.4<\/ver>\n 4.5<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n For support, please contact project team on the forums.<\/comments>\n<\/extension>\n", "com.webaccessglobal.module.civimobile": "\n\n https:\/\/github.com\/webaccess\/com.webaccessglobal.module.civimobile\/archive\/2.0.zip<\/downloadUrl>\n civimobile<\/file>\n CiviMobile<\/name>\n Mobile interface for CiviCRM<\/description>\n \n http:\/\/civicrm.org\/extensions\/civimobile<\/url>\n https:\/\/github.com\/webaccess\/com.webaccessglobal.module.civimobile<\/url>\n https:\/\/github.com\/webaccess\/com.webaccessglobal.module.civimobile\/issues<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n AGPL-3.0<\/license>\n \n Web Access<\/author>\n info@webaccessglobal.com<\/email>\n <\/maintainer>\n 2016-04-12<\/releaseDate>\n 2.0<\/version>\n stable<\/develStage>\n \n 4.7<\/ver>\n <\/compatibility>\n For support, please contact the team on github. (https:\/\/github.com\/webaccess\/com.webaccessglobal.module.civimobile\/issues)<\/comments>\n<\/extension>\n", "net.ourpowerbase.sumfields": "\n\n sumfields<\/file>\n Summary Fields<\/name>\n The Summary Fields extension creates read-only custom data fields that extend Contact and are automatically populated with up-to-date totals such as total lifetime contributions, last contribution amount, last attended event, etc.<\/description>\n GPL version 3<\/license>\n \n Jamie McClelland\/Progressive Technology Project<\/author>\n jamie@progressivetech.org<\/email>\n <\/maintainer>\n 2016-07-27<\/releaseDate>\n 2.0.6<\/version>\n stable<\/develStage>\n \n 4.4<\/ver>\n 4.5<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n This extension adds custom data fields and triggers to your database. Disabling this extension will cause the custom data fields to be deleted and triggers removed.<\/comments>\n \n CRM\/Sumfields<\/namespace>\n <\/civix>\n \n https:\/\/github.com\/progressivetech\/net.ourpowerbase.sumfields<\/url>\n https:\/\/github.com\/progressivetech\/net.ourpowerbase.sumfields<\/url>\n <\/urls>\nhttps:\/\/github.com\/progressivetech\/net.ourpowerbase.sumfields\/archive\/v2.0.6.zip<\/downloadUrl><\/extension>\n", - "uk.co.compucorp.civicrm.booking": "\n\n booking<\/file>\n CiviBooking<\/name>\n A CMS independent extension to allow organisations to manage a group of resources (i.e. rooms) offering these to constituents for a fee.<\/description>\n the GNU Affero General Public License 3 (GNU AGPL 3) and the CiviCRM Licensing Exception.<\/license>\n \n Erawat Chamanont, Jamie Novick, Guanhuan Chen<\/author>\n jamie@compucorpc.o.uk, guanhuan@compucorp.co.uk<\/email>\n <\/maintainer>\n \n http:\/\/civicrm.org\/extensions\/civibooking<\/url>\n https:\/\/github.com\/compucorp\/civibooking<\/url>\n support@compucorp.co.uk<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n \n 2016-07-25<\/releaseDate>\n 1.5<\/version>\n stable<\/develStage>\n \n 4.5<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n \n \n CRM\/Booking<\/namespace>\n <\/civix>\nhttps:\/\/github.com\/compucorp\/civibooking\/archive\/v1.5.zip<\/downloadUrl><\/extension>\n", + "uk.co.compucorp.civicrm.booking": "\n\n booking<\/file>\n CiviBooking<\/name>\n A CMS independent extension to allow organisations to manage a group of resources (i.e. rooms) offering these to constituents for a fee.<\/description>\n the GNU Affero General Public License 3 (GNU AGPL 3) and the CiviCRM Licensing Exception.<\/license>\n \n Erawat Chamanont, Jamie Novick, Guanhuan Chen<\/author>\n jamie@compucorpc.o.uk, guanhuan@compucorp.co.uk<\/email>\n <\/maintainer>\n \n http:\/\/civicrm.org\/extensions\/civibooking<\/url>\n https:\/\/github.com\/compucorp\/civibooking<\/url>\n support@compucorp.co.uk<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n \n 2016-07-25<\/releaseDate>\n 1.5<\/version>\n stable<\/develStage>\n \n 4.5<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n \n \n CRM\/Booking<\/namespace>\n <\/civix>\nhttps:\/\/github.com\/compucorp\/civibooking\/archive\/v1.5.zip<\/downloadUrl><\/extension>\n", "org.civicrm.volunteer": "\n\n volunteer<\/file>\n CiviVolunteer<\/name>\n The CiviVolunteer extension provides tools for signing up, managing, and tracking volunteers.<\/description>\n AGPL-3.0<\/license>\n \n Ginkgo Street Labs; CiviCRM, LLC; and the CiviCRM community<\/author>\n inquire@ginkgostreet.com<\/email>\n <\/maintainer>\n 2016-08-10<\/releaseDate>\n 4.6-2.1.2<\/version>\n stable<\/develStage>\n \n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n \n Developed by Ginkgo Street Labs and CiviCRM, LLC with contributions from the community. Special thanks to Friends of Georgia State Parks & Historic Sites for funding the initial release, and to The Manhattan Neighborhood Network for funding the 1.4 release.\n <\/comments>\n \n CRM\/Volunteer<\/namespace>\n <\/civix>\n \n http:\/\/civicrm.github.io\/org.civicrm.volunteer\/docs<\/url>\n <\/urls>\nhttps:\/\/github.com\/civicrm\/org.civicrm.volunteer\/archive\/v4.6-2.1.2.zip<\/downloadUrl><\/extension>\n", "nz.co.fuzion.csvimport": "\n\n csvimport<\/file>\n CSV GUI Import to api<\/name>\n Simply makes gui import available to api<\/description>\n AGPL<\/license>\n \n https:\/\/github.com\/eileenmcnaughton\/nz.co.fuzion.csvimport\/blob\/master\/README<\/url>\n https:\/\/github.com\/eileenmcnaughton\/nz.co.fuzion.csvimport\/blob\/master\/README<\/url>\n http:\/\/forum.civicrm.org<\/url>\n http:\/\/civicrm.org\/licensing<\/url>\n <\/urls>\n \n Eileen<\/author>\n eileen@fuzion.co.nz<\/email>\n <\/maintainer>\n 2016-06-11<\/releaseDate>\n 1.2<\/version>\n stable<\/develStage>\n \n 4.4<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n This is module which adds a UI to api create actions. There are no plans to provide free support for it<\/comments>\n \n CRM\/Csvimport<\/namespace>\n <\/civix>\nhttps:\/\/github.com\/eileenmcnaughton\/nz.co.fuzion.csvimport\/archive\/1.2.zip<\/downloadUrl><\/extension>\n", "com.chrischinchilla.ewayrecurring": "\n\n ewayrecurring<\/file>\n eWay Recurring<\/name>\n Recurring payments payment processor for eWay<\/description>\n \n http:\/\/civicrm.org<\/url>\n http:\/\/civicrm.org<\/url>\n http:\/\/civicrm.org<\/url>\n http:\/\/civicrm.org<\/url>\n <\/urls>\n AGPL<\/license>\n \n Melbourne CiviCRM<\/author>\n noreply@civicrm.org<\/email>\n <\/maintainer>\n 2016-09-04<\/releaseDate>\n 1.2<\/version>\n stable<\/develStage>\n \n 4.4<\/ver>\n 4.5<\/ver>\n 4.6<\/ver>\n 4.7<\/ver>\n <\/compatibility>\n \n \n CRM\/Ewayrecurring<\/namespace>\n <\/civix>\nhttps:\/\/github.com\/ChrisChinchilla\/CiviCRM-eWay-recurring-payment-processor\/archive\/1.2.zip<\/downloadUrl><\/extension>\n", -- 2.25.1