-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #342 from ankush-maherwal/joomla-4
Task #173069 feat: Update infra extensions code used in JGive to make…
- Loading branch information
Showing
6 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/** | ||
* @package TJ-Fields | ||
* | ||
* @author Techjoomla <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 TechJoomla. All rights reserved. | ||
* @license GNU General Public License version 2 or later. | ||
*/ | ||
|
||
// No direct access | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
use Joomla\CMS\Factory; | ||
|
||
/** | ||
* Migration file for TJ-Fields | ||
* | ||
* @since 1.0 | ||
*/ | ||
class TjHouseKeepingFileFieldFix extends TjModelHouseKeeping | ||
{ | ||
public $title = "Update File field with TJFile field"; | ||
|
||
public $description = "Remove file field class used for TJ-FIelds and replace it with TJ-File field"; | ||
|
||
/** | ||
* Default value migration script | ||
* | ||
* @return void | ||
* | ||
* @since 1.0 | ||
*/ | ||
public function migrate() | ||
{ | ||
$result = array(); | ||
|
||
try | ||
{ | ||
$db = Factory::getDbo(); | ||
$query = $db->getQuery(true); | ||
|
||
$fields = array( | ||
$db->quoteName('type') . ' = ' . $db->quote('tjfile') | ||
); | ||
|
||
$conditions = array( | ||
$db->quoteName('type') . ' = ' . $db->quote('file') | ||
); | ||
|
||
$query->update($db->quoteName('#__tjfields_fields'))->set($fields)->where($conditions); | ||
$db->setQuery($query); | ||
$result = $db->execute(); | ||
|
||
$result['status'] = true; | ||
$result['message'] = "Migration successful"; | ||
} | ||
catch (Exception $e) | ||
{ | ||
$result['err_code'] = ''; | ||
$result['status'] = false; | ||
$result['message'] = $e->getMessage(); | ||
} | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters