Magento 2.2.6 | Uncaught Error: Undefined class constant 'CACHE_TAG'Error in custom Admin menu controller - Magento 2Magento 2 Custom module admin controller errorMagento 2 Sending emails triggered by observerMagento2 (v2.2) Error Login Admin + FrontendUnable to synchronized app import configuration failedMagento 2.2 Fatal error: Uncaught ReflectionException: errorAdd to cart button freezes and nothing is put in basketMagento 2 Fatal Error on Setup pageMagento 2.2.3 CE unable to add/remove item from wishlist?Magento 2 Fatal error: Uncaught Error: Call to undefined method MagentoFrameworkSessionSaveHandlerNative::write()
French for 'It must be my imagination'?
Why does nature favour the Laplacian?
How to stop co-workers from teasing me because I know Russian?
What's the polite way to say "I need to urinate"?
How do Bards prepare spells?
How come there are so many candidates for the 2020 Democratic party presidential nomination?
A Note on N!
Why don't other Westeros houses use wildfire?
simple conditions equation
Was is really necessary for the Lunar module LM to have 2 stages?
What route did the Hindenburg take when traveling from Germany to the U.S.?
Examples of subgroups where it's nontrivial to show closure under multiplication?
Is there a way to get a compiler for the original B programming language?
How can the Zone of Truth spell be defeated without the caster knowing?
Critique of timeline aesthetic
Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?
Which big number is bigger?
US visa is under administrative processing, I need the passport back ASAP
Does the sign matter for proportionality?
A Strange Latex Symbol
Sci-fi novel series with instant travel between planets through gates. A river runs through the gates
How to solve constants out of the internal energy equation?
how to sum variables from file in bash
How to pronounce 'C++' in Spanish
Magento 2.2.6 | Uncaught Error: Undefined class constant 'CACHE_TAG'
Error in custom Admin menu controller - Magento 2Magento 2 Custom module admin controller errorMagento 2 Sending emails triggered by observerMagento2 (v2.2) Error Login Admin + FrontendUnable to synchronized app import configuration failedMagento 2.2 Fatal error: Uncaught ReflectionException: errorAdd to cart button freezes and nothing is put in basketMagento 2 Fatal Error on Setup pageMagento 2.2.3 CE unable to add/remove item from wishlist?Magento 2 Fatal error: Uncaught Error: Call to undefined method MagentoFrameworkSessionSaveHandlerNative::write()
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am very new to Magento, i created a CRUD custom module, when I input some data in form, and hit save button, I got an error like this:
Fatal error: Uncaught Error: Undefined class constant 'CACHE_TAG' in
C:xampphtdocstest-localappcodeTestingSimpleNewsModelNews.php:9
Stack trace: #0 C:xampphtdocstest-localvendormagentoframeworkAppCacheTagStrategyIdentifier.php(25):TestingSimpleNewModeNews->getIdentities()
#1 C:xampphtdocstest-localvendormagentoframeworkAppCacheTagResolver.php(43): MagentoFrameworkAppCacheTagStrategyIdentifier->getTags(Object(TestingSimpleNewsModelNews))
#2 C:xampphtdocstest-localvendormagentomodule-page-cacheObserverFlushCacheByTags.php(64): MagentoFrameworkAppCacheTagResolver->getTags(Object(TestingSimpleNewsModelNews))
#3 C:xampphtdocstest-localvendormagentoframeworkEventInvokerInvokerDefault.php(72): MagentoPageCacheObserverFlushCacheByTags->execute(Object(MagentoFrameworkEventObserver))
#4 C:xampphtdocstest-localvendormagentoframeworkEventInvokerInvokerDefault.php(60): MagentoFrameworkEventInvokerInvokerDefault->_callObserverMethod(Object(Magento in C:xampphtdocstest-localappcodeTestingSimpleNewsModelNews.php on line 9
This is my htdocstest-localappcodeTestingSimpleNewsModelNews.php
code:
<?php
namespace TestingSimpleNewsModel;
class News extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface
public function getIdentities()
return [self::CACHE_TAG . '_' . $this->getId()];
public function getDefaultValues()
$values = [];
return $values;
/**
* Define resource model
*/
protected function _construct()
$this->_init('TestingSimpleNewsModelResourceNews');
magento2 magento2.2.6 crud
New contributor
add a comment |
I am very new to Magento, i created a CRUD custom module, when I input some data in form, and hit save button, I got an error like this:
Fatal error: Uncaught Error: Undefined class constant 'CACHE_TAG' in
C:xampphtdocstest-localappcodeTestingSimpleNewsModelNews.php:9
Stack trace: #0 C:xampphtdocstest-localvendormagentoframeworkAppCacheTagStrategyIdentifier.php(25):TestingSimpleNewModeNews->getIdentities()
#1 C:xampphtdocstest-localvendormagentoframeworkAppCacheTagResolver.php(43): MagentoFrameworkAppCacheTagStrategyIdentifier->getTags(Object(TestingSimpleNewsModelNews))
#2 C:xampphtdocstest-localvendormagentomodule-page-cacheObserverFlushCacheByTags.php(64): MagentoFrameworkAppCacheTagResolver->getTags(Object(TestingSimpleNewsModelNews))
#3 C:xampphtdocstest-localvendormagentoframeworkEventInvokerInvokerDefault.php(72): MagentoPageCacheObserverFlushCacheByTags->execute(Object(MagentoFrameworkEventObserver))
#4 C:xampphtdocstest-localvendormagentoframeworkEventInvokerInvokerDefault.php(60): MagentoFrameworkEventInvokerInvokerDefault->_callObserverMethod(Object(Magento in C:xampphtdocstest-localappcodeTestingSimpleNewsModelNews.php on line 9
This is my htdocstest-localappcodeTestingSimpleNewsModelNews.php
code:
<?php
namespace TestingSimpleNewsModel;
class News extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface
public function getIdentities()
return [self::CACHE_TAG . '_' . $this->getId()];
public function getDefaultValues()
$values = [];
return $values;
/**
* Define resource model
*/
protected function _construct()
$this->_init('TestingSimpleNewsModelResourceNews');
magento2 magento2.2.6 crud
New contributor
add a comment |
I am very new to Magento, i created a CRUD custom module, when I input some data in form, and hit save button, I got an error like this:
Fatal error: Uncaught Error: Undefined class constant 'CACHE_TAG' in
C:xampphtdocstest-localappcodeTestingSimpleNewsModelNews.php:9
Stack trace: #0 C:xampphtdocstest-localvendormagentoframeworkAppCacheTagStrategyIdentifier.php(25):TestingSimpleNewModeNews->getIdentities()
#1 C:xampphtdocstest-localvendormagentoframeworkAppCacheTagResolver.php(43): MagentoFrameworkAppCacheTagStrategyIdentifier->getTags(Object(TestingSimpleNewsModelNews))
#2 C:xampphtdocstest-localvendormagentomodule-page-cacheObserverFlushCacheByTags.php(64): MagentoFrameworkAppCacheTagResolver->getTags(Object(TestingSimpleNewsModelNews))
#3 C:xampphtdocstest-localvendormagentoframeworkEventInvokerInvokerDefault.php(72): MagentoPageCacheObserverFlushCacheByTags->execute(Object(MagentoFrameworkEventObserver))
#4 C:xampphtdocstest-localvendormagentoframeworkEventInvokerInvokerDefault.php(60): MagentoFrameworkEventInvokerInvokerDefault->_callObserverMethod(Object(Magento in C:xampphtdocstest-localappcodeTestingSimpleNewsModelNews.php on line 9
This is my htdocstest-localappcodeTestingSimpleNewsModelNews.php
code:
<?php
namespace TestingSimpleNewsModel;
class News extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface
public function getIdentities()
return [self::CACHE_TAG . '_' . $this->getId()];
public function getDefaultValues()
$values = [];
return $values;
/**
* Define resource model
*/
protected function _construct()
$this->_init('TestingSimpleNewsModelResourceNews');
magento2 magento2.2.6 crud
New contributor
I am very new to Magento, i created a CRUD custom module, when I input some data in form, and hit save button, I got an error like this:
Fatal error: Uncaught Error: Undefined class constant 'CACHE_TAG' in
C:xampphtdocstest-localappcodeTestingSimpleNewsModelNews.php:9
Stack trace: #0 C:xampphtdocstest-localvendormagentoframeworkAppCacheTagStrategyIdentifier.php(25):TestingSimpleNewModeNews->getIdentities()
#1 C:xampphtdocstest-localvendormagentoframeworkAppCacheTagResolver.php(43): MagentoFrameworkAppCacheTagStrategyIdentifier->getTags(Object(TestingSimpleNewsModelNews))
#2 C:xampphtdocstest-localvendormagentomodule-page-cacheObserverFlushCacheByTags.php(64): MagentoFrameworkAppCacheTagResolver->getTags(Object(TestingSimpleNewsModelNews))
#3 C:xampphtdocstest-localvendormagentoframeworkEventInvokerInvokerDefault.php(72): MagentoPageCacheObserverFlushCacheByTags->execute(Object(MagentoFrameworkEventObserver))
#4 C:xampphtdocstest-localvendormagentoframeworkEventInvokerInvokerDefault.php(60): MagentoFrameworkEventInvokerInvokerDefault->_callObserverMethod(Object(Magento in C:xampphtdocstest-localappcodeTestingSimpleNewsModelNews.php on line 9
This is my htdocstest-localappcodeTestingSimpleNewsModelNews.php
code:
<?php
namespace TestingSimpleNewsModel;
class News extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface
public function getIdentities()
return [self::CACHE_TAG . '_' . $this->getId()];
public function getDefaultValues()
$values = [];
return $values;
/**
* Define resource model
*/
protected function _construct()
$this->_init('TestingSimpleNewsModelResourceNews');
magento2 magento2.2.6 crud
magento2 magento2.2.6 crud
New contributor
New contributor
edited Apr 24 at 16:13
Yann Martel
11716
11716
New contributor
asked Apr 24 at 15:49
Saif ZakirSaif Zakir
32
32
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In the function getIdentities()
in your class you can see that the class constant CACHE_TAG is being used. You can read all about class constants here:
I would suggest defining it at the top of your class, this cache tag let's magento know where to store cached data. An example would be:
namespace TestingSimpleNewsModel;
class News extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface
const CACHE_TAG = 'TESTING_SIMPLE_NEWS';
public function getIdentities()
return [self::CACHE_TAG . '_' . $this->getId()];
public function getDefaultValues()
$values = [];
return $values;
/**
* Define resource model
*/
protected function _construct()
$this->_init('TestingSimpleNewsModelResourceNews');
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Saif Zakir is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f272321%2fmagento-2-2-6-uncaught-error-undefined-class-constant-cache-tag%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In the function getIdentities()
in your class you can see that the class constant CACHE_TAG is being used. You can read all about class constants here:
I would suggest defining it at the top of your class, this cache tag let's magento know where to store cached data. An example would be:
namespace TestingSimpleNewsModel;
class News extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface
const CACHE_TAG = 'TESTING_SIMPLE_NEWS';
public function getIdentities()
return [self::CACHE_TAG . '_' . $this->getId()];
public function getDefaultValues()
$values = [];
return $values;
/**
* Define resource model
*/
protected function _construct()
$this->_init('TestingSimpleNewsModelResourceNews');
add a comment |
In the function getIdentities()
in your class you can see that the class constant CACHE_TAG is being used. You can read all about class constants here:
I would suggest defining it at the top of your class, this cache tag let's magento know where to store cached data. An example would be:
namespace TestingSimpleNewsModel;
class News extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface
const CACHE_TAG = 'TESTING_SIMPLE_NEWS';
public function getIdentities()
return [self::CACHE_TAG . '_' . $this->getId()];
public function getDefaultValues()
$values = [];
return $values;
/**
* Define resource model
*/
protected function _construct()
$this->_init('TestingSimpleNewsModelResourceNews');
add a comment |
In the function getIdentities()
in your class you can see that the class constant CACHE_TAG is being used. You can read all about class constants here:
I would suggest defining it at the top of your class, this cache tag let's magento know where to store cached data. An example would be:
namespace TestingSimpleNewsModel;
class News extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface
const CACHE_TAG = 'TESTING_SIMPLE_NEWS';
public function getIdentities()
return [self::CACHE_TAG . '_' . $this->getId()];
public function getDefaultValues()
$values = [];
return $values;
/**
* Define resource model
*/
protected function _construct()
$this->_init('TestingSimpleNewsModelResourceNews');
In the function getIdentities()
in your class you can see that the class constant CACHE_TAG is being used. You can read all about class constants here:
I would suggest defining it at the top of your class, this cache tag let's magento know where to store cached data. An example would be:
namespace TestingSimpleNewsModel;
class News extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface
const CACHE_TAG = 'TESTING_SIMPLE_NEWS';
public function getIdentities()
return [self::CACHE_TAG . '_' . $this->getId()];
public function getDefaultValues()
$values = [];
return $values;
/**
* Define resource model
*/
protected function _construct()
$this->_init('TestingSimpleNewsModelResourceNews');
edited Apr 24 at 16:50
Yann Martel
11716
11716
answered Apr 24 at 16:01
smentinksmentink
162
162
add a comment |
add a comment |
Saif Zakir is a new contributor. Be nice, and check out our Code of Conduct.
Saif Zakir is a new contributor. Be nice, and check out our Code of Conduct.
Saif Zakir is a new contributor. Be nice, and check out our Code of Conduct.
Saif Zakir is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f272321%2fmagento-2-2-6-uncaught-error-undefined-class-constant-cache-tag%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown