Warning: strlen() expects parameter 1
Im constantly seeing the following error in system.log I've gone into the file but cant see anything wrong can any one help me?
Warning: strlen() expects parameter 1 to be string, array given in /app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php on line 93
php
add a comment |
Im constantly seeing the following error in system.log I've gone into the file but cant see anything wrong can any one help me?
Warning: strlen() expects parameter 1 to be string, array given in /app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php on line 93
php
Do you use an old version of Amasty Order Attributes? :-) Upgrade the extension.
– Fabian Blechschmidt
May 28 '14 at 10:46
@FabianBlechschmidt Nope ive never used that module we have used the promo items though?
– Will Wright
May 28 '14 at 10:56
I know this error from the OrderAttributes extension, but maybe it happens there too...
– Fabian Blechschmidt
May 28 '14 at 12:15
Which concrete Magento version are you using?
– Raul Sanchez
Jan 21 at 17:43
@RaulSanchez it was some version of 1.9 probably 1.9.2.x any way onto M2 now
– Will Wright
Jan 21 at 17:46
add a comment |
Im constantly seeing the following error in system.log I've gone into the file but cant see anything wrong can any one help me?
Warning: strlen() expects parameter 1 to be string, array given in /app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php on line 93
php
Im constantly seeing the following error in system.log I've gone into the file but cant see anything wrong can any one help me?
Warning: strlen() expects parameter 1 to be string, array given in /app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php on line 93
php
php
edited Jan 21 at 17:25
Will Wright
asked May 28 '14 at 10:13
Will WrightWill Wright
3171213
3171213
Do you use an old version of Amasty Order Attributes? :-) Upgrade the extension.
– Fabian Blechschmidt
May 28 '14 at 10:46
@FabianBlechschmidt Nope ive never used that module we have used the promo items though?
– Will Wright
May 28 '14 at 10:56
I know this error from the OrderAttributes extension, but maybe it happens there too...
– Fabian Blechschmidt
May 28 '14 at 12:15
Which concrete Magento version are you using?
– Raul Sanchez
Jan 21 at 17:43
@RaulSanchez it was some version of 1.9 probably 1.9.2.x any way onto M2 now
– Will Wright
Jan 21 at 17:46
add a comment |
Do you use an old version of Amasty Order Attributes? :-) Upgrade the extension.
– Fabian Blechschmidt
May 28 '14 at 10:46
@FabianBlechschmidt Nope ive never used that module we have used the promo items though?
– Will Wright
May 28 '14 at 10:56
I know this error from the OrderAttributes extension, but maybe it happens there too...
– Fabian Blechschmidt
May 28 '14 at 12:15
Which concrete Magento version are you using?
– Raul Sanchez
Jan 21 at 17:43
@RaulSanchez it was some version of 1.9 probably 1.9.2.x any way onto M2 now
– Will Wright
Jan 21 at 17:46
Do you use an old version of Amasty Order Attributes? :-) Upgrade the extension.
– Fabian Blechschmidt
May 28 '14 at 10:46
Do you use an old version of Amasty Order Attributes? :-) Upgrade the extension.
– Fabian Blechschmidt
May 28 '14 at 10:46
@FabianBlechschmidt Nope ive never used that module we have used the promo items though?
– Will Wright
May 28 '14 at 10:56
@FabianBlechschmidt Nope ive never used that module we have used the promo items though?
– Will Wright
May 28 '14 at 10:56
I know this error from the OrderAttributes extension, but maybe it happens there too...
– Fabian Blechschmidt
May 28 '14 at 12:15
I know this error from the OrderAttributes extension, but maybe it happens there too...
– Fabian Blechschmidt
May 28 '14 at 12:15
Which concrete Magento version are you using?
– Raul Sanchez
Jan 21 at 17:43
Which concrete Magento version are you using?
– Raul Sanchez
Jan 21 at 17:43
@RaulSanchez it was some version of 1.9 probably 1.9.2.x any way onto M2 now
– Will Wright
Jan 21 at 17:46
@RaulSanchez it was some version of 1.9 probably 1.9.2.x any way onto M2 now
– Will Wright
Jan 21 at 17:46
add a comment |
2 Answers
2
active
oldest
votes
This is from my copy (1.7.0.2) of app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php
_getOptionText
is returning an array, not a string like the code is clearly expecting. I'd see what class getFrontend
is returning and then see how that can be returning an array.
protected function _getOptionText($optionId)
{
return $this->getAttributeModel()->getFrontend()->getOption($optionId);
}
/**
* Apply attribute option filter to product collection
*
* @param Zend_Controller_Request_Abstract $request
* @param Varien_Object $filterBlock
* @return Mage_Catalog_Model_Layer_Filter_Attribute
*/
public function apply(Zend_Controller_Request_Abstract $request, $filterBlock)
{
$filter = $request->getParam($this->_requestVar);
if (is_array($filter)) {
return $this;
}
$text = $this->_getOptionText($filter);
if ($filter && strlen($text)) {
$this->_getResource()->applyFilterToCollection($this, $filter);
$this->getLayer()->getState()->addFilter($this->_createItem($text, $filter));
$this->_items = array();
}
return $this;
}
+1 someone who offers some decent advice and explains how to understand the problem, not a hack.
– ash
May 28 '14 at 13:36
add a comment |
strlen() is a function which gives the length of the string you passed as a parameter.
The error is that you must be passing an array in the strlen(). Please check the value you are passing.
It should be string.
Check your file "Attribute.php" at line no. 93.
2
downvoted - because stating the obvious and rewording the error in laymans terms doesn't really answer the question. I'm presuming the point of the question is more understanding why Magentos' Core is fragmented.
– ash
May 28 '14 at 13:33
Upvote, I don't see why this answer couldn't be valid
– Raul Sanchez
Jan 21 at 17:44
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
});
}
});
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%2f21651%2fwarning-strlen-expects-parameter-1%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is from my copy (1.7.0.2) of app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php
_getOptionText
is returning an array, not a string like the code is clearly expecting. I'd see what class getFrontend
is returning and then see how that can be returning an array.
protected function _getOptionText($optionId)
{
return $this->getAttributeModel()->getFrontend()->getOption($optionId);
}
/**
* Apply attribute option filter to product collection
*
* @param Zend_Controller_Request_Abstract $request
* @param Varien_Object $filterBlock
* @return Mage_Catalog_Model_Layer_Filter_Attribute
*/
public function apply(Zend_Controller_Request_Abstract $request, $filterBlock)
{
$filter = $request->getParam($this->_requestVar);
if (is_array($filter)) {
return $this;
}
$text = $this->_getOptionText($filter);
if ($filter && strlen($text)) {
$this->_getResource()->applyFilterToCollection($this, $filter);
$this->getLayer()->getState()->addFilter($this->_createItem($text, $filter));
$this->_items = array();
}
return $this;
}
+1 someone who offers some decent advice and explains how to understand the problem, not a hack.
– ash
May 28 '14 at 13:36
add a comment |
This is from my copy (1.7.0.2) of app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php
_getOptionText
is returning an array, not a string like the code is clearly expecting. I'd see what class getFrontend
is returning and then see how that can be returning an array.
protected function _getOptionText($optionId)
{
return $this->getAttributeModel()->getFrontend()->getOption($optionId);
}
/**
* Apply attribute option filter to product collection
*
* @param Zend_Controller_Request_Abstract $request
* @param Varien_Object $filterBlock
* @return Mage_Catalog_Model_Layer_Filter_Attribute
*/
public function apply(Zend_Controller_Request_Abstract $request, $filterBlock)
{
$filter = $request->getParam($this->_requestVar);
if (is_array($filter)) {
return $this;
}
$text = $this->_getOptionText($filter);
if ($filter && strlen($text)) {
$this->_getResource()->applyFilterToCollection($this, $filter);
$this->getLayer()->getState()->addFilter($this->_createItem($text, $filter));
$this->_items = array();
}
return $this;
}
+1 someone who offers some decent advice and explains how to understand the problem, not a hack.
– ash
May 28 '14 at 13:36
add a comment |
This is from my copy (1.7.0.2) of app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php
_getOptionText
is returning an array, not a string like the code is clearly expecting. I'd see what class getFrontend
is returning and then see how that can be returning an array.
protected function _getOptionText($optionId)
{
return $this->getAttributeModel()->getFrontend()->getOption($optionId);
}
/**
* Apply attribute option filter to product collection
*
* @param Zend_Controller_Request_Abstract $request
* @param Varien_Object $filterBlock
* @return Mage_Catalog_Model_Layer_Filter_Attribute
*/
public function apply(Zend_Controller_Request_Abstract $request, $filterBlock)
{
$filter = $request->getParam($this->_requestVar);
if (is_array($filter)) {
return $this;
}
$text = $this->_getOptionText($filter);
if ($filter && strlen($text)) {
$this->_getResource()->applyFilterToCollection($this, $filter);
$this->getLayer()->getState()->addFilter($this->_createItem($text, $filter));
$this->_items = array();
}
return $this;
}
This is from my copy (1.7.0.2) of app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php
_getOptionText
is returning an array, not a string like the code is clearly expecting. I'd see what class getFrontend
is returning and then see how that can be returning an array.
protected function _getOptionText($optionId)
{
return $this->getAttributeModel()->getFrontend()->getOption($optionId);
}
/**
* Apply attribute option filter to product collection
*
* @param Zend_Controller_Request_Abstract $request
* @param Varien_Object $filterBlock
* @return Mage_Catalog_Model_Layer_Filter_Attribute
*/
public function apply(Zend_Controller_Request_Abstract $request, $filterBlock)
{
$filter = $request->getParam($this->_requestVar);
if (is_array($filter)) {
return $this;
}
$text = $this->_getOptionText($filter);
if ($filter && strlen($text)) {
$this->_getResource()->applyFilterToCollection($this, $filter);
$this->getLayer()->getState()->addFilter($this->_createItem($text, $filter));
$this->_items = array();
}
return $this;
}
answered May 28 '14 at 12:48
RichardRichard
1,662717
1,662717
+1 someone who offers some decent advice and explains how to understand the problem, not a hack.
– ash
May 28 '14 at 13:36
add a comment |
+1 someone who offers some decent advice and explains how to understand the problem, not a hack.
– ash
May 28 '14 at 13:36
+1 someone who offers some decent advice and explains how to understand the problem, not a hack.
– ash
May 28 '14 at 13:36
+1 someone who offers some decent advice and explains how to understand the problem, not a hack.
– ash
May 28 '14 at 13:36
add a comment |
strlen() is a function which gives the length of the string you passed as a parameter.
The error is that you must be passing an array in the strlen(). Please check the value you are passing.
It should be string.
Check your file "Attribute.php" at line no. 93.
2
downvoted - because stating the obvious and rewording the error in laymans terms doesn't really answer the question. I'm presuming the point of the question is more understanding why Magentos' Core is fragmented.
– ash
May 28 '14 at 13:33
Upvote, I don't see why this answer couldn't be valid
– Raul Sanchez
Jan 21 at 17:44
add a comment |
strlen() is a function which gives the length of the string you passed as a parameter.
The error is that you must be passing an array in the strlen(). Please check the value you are passing.
It should be string.
Check your file "Attribute.php" at line no. 93.
2
downvoted - because stating the obvious and rewording the error in laymans terms doesn't really answer the question. I'm presuming the point of the question is more understanding why Magentos' Core is fragmented.
– ash
May 28 '14 at 13:33
Upvote, I don't see why this answer couldn't be valid
– Raul Sanchez
Jan 21 at 17:44
add a comment |
strlen() is a function which gives the length of the string you passed as a parameter.
The error is that you must be passing an array in the strlen(). Please check the value you are passing.
It should be string.
Check your file "Attribute.php" at line no. 93.
strlen() is a function which gives the length of the string you passed as a parameter.
The error is that you must be passing an array in the strlen(). Please check the value you are passing.
It should be string.
Check your file "Attribute.php" at line no. 93.
answered May 28 '14 at 10:15
WaseemWaseem
56211336
56211336
2
downvoted - because stating the obvious and rewording the error in laymans terms doesn't really answer the question. I'm presuming the point of the question is more understanding why Magentos' Core is fragmented.
– ash
May 28 '14 at 13:33
Upvote, I don't see why this answer couldn't be valid
– Raul Sanchez
Jan 21 at 17:44
add a comment |
2
downvoted - because stating the obvious and rewording the error in laymans terms doesn't really answer the question. I'm presuming the point of the question is more understanding why Magentos' Core is fragmented.
– ash
May 28 '14 at 13:33
Upvote, I don't see why this answer couldn't be valid
– Raul Sanchez
Jan 21 at 17:44
2
2
downvoted - because stating the obvious and rewording the error in laymans terms doesn't really answer the question. I'm presuming the point of the question is more understanding why Magentos' Core is fragmented.
– ash
May 28 '14 at 13:33
downvoted - because stating the obvious and rewording the error in laymans terms doesn't really answer the question. I'm presuming the point of the question is more understanding why Magentos' Core is fragmented.
– ash
May 28 '14 at 13:33
Upvote, I don't see why this answer couldn't be valid
– Raul Sanchez
Jan 21 at 17:44
Upvote, I don't see why this answer couldn't be valid
– Raul Sanchez
Jan 21 at 17:44
add a comment |
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%2f21651%2fwarning-strlen-expects-parameter-1%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
Do you use an old version of Amasty Order Attributes? :-) Upgrade the extension.
– Fabian Blechschmidt
May 28 '14 at 10:46
@FabianBlechschmidt Nope ive never used that module we have used the promo items though?
– Will Wright
May 28 '14 at 10:56
I know this error from the OrderAttributes extension, but maybe it happens there too...
– Fabian Blechschmidt
May 28 '14 at 12:15
Which concrete Magento version are you using?
– Raul Sanchez
Jan 21 at 17:43
@RaulSanchez it was some version of 1.9 probably 1.9.2.x any way onto M2 now
– Will Wright
Jan 21 at 17:46