Server IP : 192.158.238.246 / Your IP : 18.117.158.108 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/7779/task/7779/cwd/plugins/give/src/Onboarding/Migrations/ |
Upload File : |
<?php namespace Give\Onboarding\Migrations; use Give\Framework\Migrations\Contracts\Migration; use Give\Onboarding\FormRepository; /** * This resolves an issue where the donation level data for the form created during onboarding was serialized as * integers instead of strings, causing issues throughout * * @since 2.13.4 preserve additional donation level data * @since 2.13.3 */ class SetFormDonationLevelsToStrings extends Migration { /** * @var FormRepository */ private $formRepository; /** * @inheritDoc */ public static function id() { return 'set-form-donation-levels-to-strings'; } /** * @inheritDoc */ public static function timestamp() { return strtotime('2020-09-01 11:47:00'); } public function __construct(FormRepository $formRepository) { $this->formRepository = $formRepository; } /** * @inheritDoc */ public function run() { $formId = $this->formRepository->getDefaultFormID(); if (empty($formId)) { return; } $donationLevels = give_get_meta($formId, '_give_donation_levels', true); foreach ($donationLevels as &$level) { $level['_give_id']['level_id'] = (string)$level['_give_id']['level_id']; $level['_give_amount'] = give_sanitize_amount_for_db($level['_give_amount']); } unset($level); update_post_meta($formId, '_give_donation_levels', $donationLevels); } }