Hot answers tagged

131

As written here: If you use restricted admin accounts, some menus of third party extensions might not work anymore for them. The reason is that the default return value of Mage_Adminhtml_Controller_Action::_isAllowed() has been changed from true to Mage::getSingleton('admin/session')->isAllowed('admin'). Extensions that do not override this method in ...


100

You can use Magento CLI to create new admin user with the following command, then you can go and change password of your original user. Execute this from the root of your magento installation: php bin/magento admin:user:create --admin-user="admin" --admin-password="123123q" --admin-email="admin@example.com" --admin-firstname="Admin" --admin-lastname="Admin"...


93

Stores > Settings > Configuration > Advanced > Admin > Security > Admin Session Lifetime (seconds) Also, there is a possibility to set this parameter directly to the database, just put a value under the path admin/security/session_lifetime in the table core_config_data Update Magento 2.1 admin cookie life time = Stores > Settings > ...


71

First of all, apply proper permissions, enable apache rewrite_module and refresh apache server. chmod -R 777 /var/www/html/MAGENTO_2_ROOT_DIRECTORY/ sudo a2enmod rewrite sudo service apache2 restart For messy frontend, run following command from Magento root: php bin/magento setup:static-content:deploy Now clear var directory except .htaccess file and ...


67

Try this solution Use below line to sort the column in grid. <item name="sortOrder" xsi:type="number">6</item> Open you database table ui_bookmark. Search the name of your uiComponent from namespce column of ui_bookmark table. You can check uiComponent name from respective layout xml. below is just an example path. /app/code/Vendor/Module/...


57

Disabling the module on command line resolves in errors on different places. A better idea is to hide it with XML. Just create a child theme (if you don't have one already) like this: How to create a Child Theme in Magento 2 and then inside your child theme create: app/design/frontend/company_name/theme_name/Magento_Theme/layout/default.xml and add this: ...


53

It also happens if the cookie domain in System > Configuration > Web > Cookies is different from the actual site domain. To remove the setting without access to the admin panel: use the following SQL query on the MySQL console or in a client like phpMyAdmin: DELETE FROM core_config_data WHERE path='web/cookie/cookie_domain'; clear the cache. If you are ...


44

This error appears when you remove a template folder, which is still referenced in the database. The simplest way to fix it is, go to the database, and in table 'theme', find the theme name which does not exist in app/design/frontend/package. DELETE the reference to the missing theme from the table.


42

NOTE: If you have changed the admin url by using the admin backend and lost access, use the steps here to regain access. How to properly change the Admin Base URL so you don't have to follow the above link. Never use the System=>Config=>Advanced=>Admin=>Admin Base URL settings to do this. It usually ends up in site fubar. Every local.xml has ...


41

Change Admin Path It is not recommended to change it directly from app/etc/env.php, always prefer the CLI: php bin/magento setup:config:set --backend-frontname="admin_path" Do not add the first / in the admin_path as it will result in an invalid parameter exception. Change Admin URL This can be done via the admin under Store > Advanced Tab > Admin Base ...


40

I have faced a similar issue and in my case, the issue was because I have incorrect tab id matching in system.xml <tab id="custom_tab" translate="label" sortOrder="2000"> <label>Custom Tab</label> </tab> <section id="custom_section" translate="label" type="text" sortOrder="40" showInDefault="1" ...


39

For the sake of completeness, you can manually add blocks and variables to the white lists under System > Permissions > Variables and System > Permissions > Blocks. The codes you add there are in the form web/unsecure/base_url (config path) or rss/order_new (block class alias). Original answer My upgrade script looks like this: /* * Make sure the upgrade ...


38

You can declare a new primary theme for your admin area by customizing config (e.g. app/etc/local.xml) with the following: <config> <stores> <admin> <design> <theme> <default>your_theme</default> </theme> </design> ...


38

I had same problem manipulating databases, this answer resolved my problem ERR_TOO_MANY_REDIRECTS : https://magento.stackexchange.com/a/84756/50635 To correct this, please try to set Use Secure URLs in Admin to true, in System -> Config -> General -> Web. Or with database access, change following record value to 1 : SELECT * FROM core_config_data ...


37

For this, I suggest using the data folder of one of your custom modules. Let's say that the module is currently at version 1.0.4. Create the file data/[module]_setup/data-upgrade-1.0.4-1.0.5.php with the following content: Edit: changed file name $content = 'BLOCK CONTENT HERE'; //if you want one block for each store view, get the store collection $...


34

That error comes up when a module does not correctly declare its commands. It just stops Magento from correctly reading the wole commands list. Unless you have broken third party modules, you probably have something left in your cache or generation folder preventing you to correctly run Magento commands. From your Magento root: rm -Rf var/cache/* rm -Rf ...


34

Read More: blog.mageprince.com With objectManager $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $state = $objectManager->get('Magento\Framework\App\State'); echo $state->getAreaCode(); //frontend or adminhtml or webapi_rest With Dependency Injection protected $_state; public function __construct ( \Magento\Framework\...


33

In general, you can apply the patch as all previous ones. Have a look at the official documentation and check this SE post. But yes, there are some additional points you should check when applying this patch. Byte/Hypernode has a nice post about it. Check if your theme has a custom template/customer/form/register.phtml or custom template/persistent/customer/...


33

Run below query to direct database. An example is for reset password for admin user. UPDATE admin_user SET `password` = SHA2('NewPassword', 256) WHERE `username`='admin'; NewPassword: Replace it with your password. I hope it will work for you. Let me know if you any difficulty.


33

It is very annoying though. For every admin page that loads, just as you are about to click on something immediately after the page loads, the whole page shifts down one row to display the error message. I've lost track of the amount of times I've clicked on something wrong because of this. A warning should be there to notify the user of something that they ...


32

Part 1 For the purpose of this demo I'm going to create a module, let's name it Easylife_News that contains an entity named Article. The module comes with complete CRUD code for backend, including the section for managing attributes, and some simple frontend listing and view page for each article. It also ads a menu item in the top menu to the listing of ...


30

In my case, I was importing an already existing Magento 2 database. The reason I was getting the error was because of the cookie domain in the database. Go to your database and look in the table core_config_data. You should see a path called web/cookie/cookie_domain. Make sure the domain matches the one you installed Magento 2 on. Ex: If you installed ...


30

You can get the details by below command in you Magento 2 instance. php bin/magento info:adminuri you can get the result like Admin URI : /kqasuydi Hope this is the simple and quick way to get.


29

For the system.xml files it doesn't work like it does for class files. The system.xml files are collected from the active modules of Magento. Just copying one in local folder it doesn't mean it's in a module, because the module declaration file still says that the module belongs to the core codepool. If you want to add new fields to a section or override ...


29

This bug arises due to php.ini variable "max_input_vars" Increase it to 10000 through below php function: ini_set('max_input_vars', 10000); OR Using linux command line cd /etc/php/7.0/apache2/ vi php.ini (Open for edit and set max_input_vars=10000) :wq(Press esc and write the mentioned command to save and exit) sudo /etc/init.d/apache2 restart(Restart ...


28

There's an menu item for this in: System > Configuration > Advanced > Admin > Security > Session Lifetime (Seconds) Also check the php environment variables php_value session.cookie_lifetime <seconds> php_value session.gc_maxlifetime <seconds> In order to ensure that you are editing the correct php.ini, create a simple "check.php" file ...


27

Try this: $this->_redirectReferer(); it does a little more than redirect to the previous page. If you specify in the url a parameter uenc it will consider that as the referrer.


27

In my case, I was importing an already existing Magento 2 database. The reason I was getting the error was because of the cookie domain in the database. Go to your database and look in the table core_config_data. You should see a path called web/cookie/cookie_domain. Make sure the domain matches the one you installed Magento 2 on. Ex: If you installed ...


27

We will describe the solution using our Others Also Bought module as the example, where MageWorx – a vendor name and AlsoBought – a module name: First, you need to add your button as a field in the configuration file. (mageworx_collect as the example): app/code/MageWorx/AlsoBought/etc/adminhtml/system.xml <?xml version="1.0"?> <!-- /** * ...


27

Please try Below steps Delete var/cache folder Go to database SELECT * FROM core_config_data WHERE path = 'web/seo/use_rewrites' and make it 0 Then enter url in your browser magento_base_url/index.php/your_admin_url try and let me know if you face any issue.


Only top voted, non community-wiki answers of a minimum length are eligible