Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed configuration name typo #3721

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function saveAction()
try {
$model->save();
// Send notification to General and additional contacts (if declared) that a new admin user was created.
if (Mage::getStoreConfigFlag('admin/security/crate_admin_user_notification') && $isNew) {
if (Mage::getStoreConfigFlag('admin/security/create_admin_user_notification') && $isNew) {
Mage::getModel('admin/user')->sendAdminNotification($model);
}
if ($uRoles = $this->getRequest()->getParam('roles', false)) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<config>
<modules>
<Mage_Core>
<version>1.6.0.10</version>
<version>1.6.0.11</version>
</Mage_Core>
</modules>
<global>
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Core/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</extensions_compatibility_mode>
<crate_admin_user_notification translate="label comment">
<create_admin_user_notification translate="label comment">
<label>New Admin User Create Notification</label>
<comment>This setting enable notification when new admin user created.</comment>
<frontend_type>select</frontend_type>
Expand All @@ -1265,7 +1265,7 @@
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</crate_admin_user_notification>
</create_admin_user_notification>
<reprocess_image_quality translate="label comment">
<label>Image Reprocess Quality</label>
<comment>The recommended value is 85, a higher value will increase the file size. You can set the value to 0 to disable image processing, but it may cause security risks.</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* OpenMage
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Core
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/** @var Mage_Core_Model_Resource_Setup $installer */
$installer = $this;
$installer->startSetup();

$table = $installer->getTable('core/config_data');

if ($installer->getConnection()->isTableExists($table)) {
$oldPath = 'admin/security/crate_admin_user_notification';
$newPath = 'admin/security/create_admin_user_notification';

$select = $installer->getConnection()->select()
->from($table, ['config_id', 'path'])
->where('path = ?', $oldPath);

$rows = $installer->getConnection()->fetchAll($select);

foreach ($rows as $row) {
$installer->getConnection()->update(
$table,
['path' => $newPath],
['config_id = ?' => $row['config_id']]
);
}
}
Comment on lines +19 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$table = $installer->getTable('core/config_data');
if ($installer->getConnection()->isTableExists($table)) {
$oldPath = 'admin/security/crate_admin_user_notification';
$newPath = 'admin/security/create_admin_user_notification';
$select = $installer->getConnection()->select()
->from($table, ['config_id', 'path'])
->where('path = ?', $oldPath);
$rows = $installer->getConnection()->fetchAll($select);
foreach ($rows as $row) {
$installer->getConnection()->update(
$table,
['path' => $newPath],
['config_id = ?' => $row['config_id']]
);
}
}
$installer->getConnection()->update(
$installer->getTable('core/config_data'),
['path' => 'admin/security/create_admin_user_notification'],
['path = ?' => 'admin/security/crate_admin_user_notification']
);

it seems easier than selecting then cycling no?

I've tested out both and I can confirm they work


$installer->endSetup();
Loading