Extend the following file
vendor/magento/framework/App/Request/CsrfValidator.php
and add the following code
if ( $request->getModuleName() == 'MODULENAME') { return; // Skip CSRF check }
Extend the following file
vendor/magento/framework/App/Request/CsrfValidator.php
and add the following code
if ( $request->getModuleName() == 'MODULENAME') { return; // Skip CSRF check }
php bin/magento admin:user:unlock --help
php bin/magento admin:user:unlock USERNAME
Select “Yes” to add this attribute to the list of column options in the product grid.
Extension attributes are new in Magento 2. They are used to extend functionalities and often use more complex data types than custom attributes. Extension Attributes are used to allow for customization of the strict Service Contracts. These attributes do not appear on the GUI.
Third-party developers cannot change the API Data interfaces defined in the Magento Core code. However, most of these entities have a feature called extension attributes. Check the interface for the methods getExtensionAttributes() and setExtensionAttributes() to determine if they are available for the entity.
Open the file \vendor\magento\framework\Serialize\Serializer\json.php and replace the function unserialize() with the below
public function unserialize($string) {
/* Added the following if clause to resolve the issue */
if($this->is_serialized($string)){
$string = $this->serialize($string);
}
$result = json_decode($string, true);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new \InvalidArgumentException('Unable to unserialize value.');
}
return $result;
}
Also add the following function as well
function is_serialized($value, &$result = null) {
// Bit of a give away this one
if (!is_string($value))
{
return false;
}
// Serialized false, return true. unserialize() returns false on an
// invalid string or it could return false if the string is serialized
// false, eliminate that possibility.
if ($value === 'b:0;')
{
$result = false;
return true;
}
$length = strlen($value);
$end = '';
switch ($value[0])
{
case 's':
if ($value[$length - 2] !== '"')
{
return false;
}
case 'b':
case 'i':
case 'd':
// This looks odd but it is quicker than isset()ing
$end .= ';';
case 'a':
case 'O':
$end .= '}';
if ($value[1] !== ':')
{
return false;
}
switch ($value[2])
{
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
break;
default:
return false;
}
case 'N':
$end .= ';';
if ($value[$length - 1] !== $end[0])
{
return false;
}
break;
default:
return false;
}
if (($result = @unserialize($value)) === false)
{
$result = null;
return false;
}
return true;
}
open the file
vendor/magento/module-authorization/Model/Acl/AclRetriever.php and replaced the below code
if (!$role) {
throw new AuthorizationException(
__('We can\'t find the role for the user you wanted.')
);
}
$allowedResources = $this->getAllowedResourcesByRole($role->getId());
with
if (!$role) {
$allowedResources = array();
}
and revert it on sucess.
Following are the fields you need to set 0 or 1 in core_config_data table to merge / unmergae css/js files.
dev/js/merge_files - Merge Js
update core_config_data set value=0 where path='dev/js/merge_files';
dev/css/merge_css_files - Merge css
update core_config_data set value=0 where path='dev/css/merge_css_files' limit 20;
I have encountered this issue while community to enterprise migration and it was happening since the base table ‘oauth_consumer‘ was not available.
CREATE TABLEoauth_consumer
(entity_id
int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
created_at
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
updated_at
timestamp NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
name
varchar(255) NOT NULL COMMENT 'Name of consumer',
key
varchar(32) NOT NULL COMMENT 'Key code',
secret
varchar(32) NOT NULL COMMENT 'Secret code',
callback_url
text COMMENT 'Callback URL',
rejected_callback_url
text NOT NULL COMMENT 'Rejected callback URL',
PRIMARY KEY (entity_id
),
UNIQUE KEYOAUTH_CONSUMER_KEY
(key
),
UNIQUE KEYOAUTH_CONSUMER_SECRET
(secret
),
KEYOAUTH_CONSUMER_CREATED_AT
(created_at
),
KEYOAUTH_CONSUMER_UPDATED_AT
(updated_at
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='OAuth Consumers';
This issue can be fixed by issuing the following queries
UPDATEstore
SET store_id = 0 WHERE code='admin';
UPDATEstore_group
SET group_id = 0 WHERE name='Default';
UPDATEstore_website
SET website_id = 0 WHERE code='admin';
It can also be solved by modify StoreManager.php (/vendor/magento/module-store/Model/StoreManager.php)
If $storeId is not defined: It retrive data from COOKIE first, otherwise return the default store code.
if (!isset($storeId) || '' === $storeId || $storeId === true) {
if (null === $this->currentStoreId) {
\Magento\Framework\Profiler::start('store.resolve');
$this->currentStoreId = $this->storeResolver->getCurrentStoreId(); \Magento\Framework\Profiler::stop('store.resolve');
}
$storeId = $this->currentStoreId;
}
To
if(!$storeId) {
if(isset($_COOKIE['store']) && $_COOKIE['store'] !== ''){
$storeId = $_COOKIE['store'];
} else {
$storeId = $this->getDefaultStoreView()->getCode();
}
}
I have fixed the issue by modifying option in config Stores>Configuration -> Advanced -> Developer ->Sign Static Files (dev_static_sign) -> No.
As the admin panel was not accessible I made this change at DB level.
insert into core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0);