Warning: strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 160Magento 2 Model resource and collection- error array_values() expects parameter 1 to be arrayDeleting from minicart items causing issueMagento 2: Warning: array_merge(): Argument #1 is not an array vendor/magento/framework/App/Config/Initial/Converter.php on line 78Magento 2 Error occured after upgrade : Warning: ltrim() expects parameter 1 to be string, array givenMagento 2 : How to get Select Options in Template from Attribute Source Modelstrpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 160Magento 2.1.11 - Interceptor throwing ltrim expects 1 parameter to be string, object given warning exceptionMagento2: Admin side getting errorFatal error: Uncaught TypeError: Argument 1 passed to __construct() must be of the type array, null giveProduct is not updating in Magento 2
Deleting missing values from a dataset
Is having access to past exams cheating and, if yes, could it be proven just by a good grade?
Why would a jet engine that runs at temps excess of 2000°C burn when it crashes?
Is "history" a male-biased word ("his+story")?
what does the apostrophe mean in this notation?
What is the likely impact on flights of grounding an entire aircraft series?
Latest web browser compatible with Windows 98
When were linguistics departments first established
Excess Zinc in garden soil
Format picture and text with TikZ and minipage
Are there situations where a child is permitted to refer to their parent by their first name?
Can't remove a file with file mode bits a+rw
What happens with multiple copies of Humility and Glorious Anthem on the battlefield?
Who is our nearest neighbor
Is this animal really missing?
Time travel short story where dinosaur doesn't taste like chicken
How to deal with a cynical class?
Is it ok to include an epilogue dedicated to colleagues who passed away in the end of the manuscript?
Best approach to update all entries in a list that is paginated?
What exactly is the purpose of connection links straped between the rocket and the launch pad
Potentiometer like component
My story is written in English, but is set in my home country. What language should I use for the dialogue?
Should QA ask requirements to developers?
What to do when during a meeting client people start to fight (even physically) with each others?
Warning: strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157
strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 160Magento 2 Model resource and collection- error array_values() expects parameter 1 to be arrayDeleting from minicart items causing issueMagento 2: Warning: array_merge(): Argument #1 is not an array vendor/magento/framework/App/Config/Initial/Converter.php on line 78Magento 2 Error occured after upgrade : Warning: ltrim() expects parameter 1 to be string, array givenMagento 2 : How to get Select Options in Template from Attribute Source Modelstrpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 160Magento 2.1.11 - Interceptor throwing ltrim expects 1 parameter to be string, object given warning exceptionMagento2: Admin side getting errorFatal error: Uncaught TypeError: Argument 1 passed to __construct() must be of the type array, null giveProduct is not updating in Magento 2
1 exception(s):
Exception #0 (Exception): Warning: strpos() expects parameter 1 to be string, array given in /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157
Exception #0 (Exception): Warning: strpos() expects parameter 1 to be string, array given in /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157
#0 [internal function]: MagentoFrameworkAppErrorHandler->handler(2, 'strpos() expect...', '/home/equpo/pub...', 157, Array)
#1 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php(157): strpos(Array, ',')
#2 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php(331): MagentoEavModelEntityAttributeSourceTable->getOptionText(Array)
#3 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php(176): MagentoEavModelEntityAttributeFrontendAbstractFrontend->getOption(Array)
when i open prouduct details page for all products
public function getOptionText($value)
{
$isMultiple = false;
if (strpos($value, ','))
$isMultiple = true;
$value = explode(',', $value);
$options = $this->getSpecificOptions($value, false);
if (!is_array($value))
$value = [$value];
$optionsText = [];
foreach ($options as $item)
if (in_array($item['value'], $value))
$optionsText[] = $this->escaper->escapeHtml($item['label']);
how i can solve this???
magento2 module array product-detail-page
|
show 3 more comments
1 exception(s):
Exception #0 (Exception): Warning: strpos() expects parameter 1 to be string, array given in /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157
Exception #0 (Exception): Warning: strpos() expects parameter 1 to be string, array given in /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157
#0 [internal function]: MagentoFrameworkAppErrorHandler->handler(2, 'strpos() expect...', '/home/equpo/pub...', 157, Array)
#1 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php(157): strpos(Array, ',')
#2 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php(331): MagentoEavModelEntityAttributeSourceTable->getOptionText(Array)
#3 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php(176): MagentoEavModelEntityAttributeFrontendAbstractFrontend->getOption(Array)
when i open prouduct details page for all products
public function getOptionText($value)
{
$isMultiple = false;
if (strpos($value, ','))
$isMultiple = true;
$value = explode(',', $value);
$options = $this->getSpecificOptions($value, false);
if (!is_array($value))
$value = [$value];
$optionsText = [];
foreach ($options as $item)
if (in_array($item['value'], $value))
$optionsText[] = $this->escaper->escapeHtml($item['label']);
how i can solve this???
magento2 module array product-detail-page
What will you get in the $value ?
– aravind
Feb 25 at 10:59
don't know bro....
– prabhakaran7
Feb 25 at 11:02
From where did u call this function ? please share the code
– aravind
Feb 25 at 11:06
i did not call this function
– prabhakaran7
Feb 25 at 11:29
Have you created any attribute ? what type of attribute is that?
– aravind
Feb 25 at 11:35
|
show 3 more comments
1 exception(s):
Exception #0 (Exception): Warning: strpos() expects parameter 1 to be string, array given in /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157
Exception #0 (Exception): Warning: strpos() expects parameter 1 to be string, array given in /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157
#0 [internal function]: MagentoFrameworkAppErrorHandler->handler(2, 'strpos() expect...', '/home/equpo/pub...', 157, Array)
#1 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php(157): strpos(Array, ',')
#2 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php(331): MagentoEavModelEntityAttributeSourceTable->getOptionText(Array)
#3 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php(176): MagentoEavModelEntityAttributeFrontendAbstractFrontend->getOption(Array)
when i open prouduct details page for all products
public function getOptionText($value)
{
$isMultiple = false;
if (strpos($value, ','))
$isMultiple = true;
$value = explode(',', $value);
$options = $this->getSpecificOptions($value, false);
if (!is_array($value))
$value = [$value];
$optionsText = [];
foreach ($options as $item)
if (in_array($item['value'], $value))
$optionsText[] = $this->escaper->escapeHtml($item['label']);
how i can solve this???
magento2 module array product-detail-page
1 exception(s):
Exception #0 (Exception): Warning: strpos() expects parameter 1 to be string, array given in /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157
Exception #0 (Exception): Warning: strpos() expects parameter 1 to be string, array given in /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 157
#0 [internal function]: MagentoFrameworkAppErrorHandler->handler(2, 'strpos() expect...', '/home/equpo/pub...', 157, Array)
#1 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php(157): strpos(Array, ',')
#2 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php(331): MagentoEavModelEntityAttributeSourceTable->getOptionText(Array)
#3 /home/equpo/public_html/demo/vendor/magento/module-eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php(176): MagentoEavModelEntityAttributeFrontendAbstractFrontend->getOption(Array)
when i open prouduct details page for all products
public function getOptionText($value)
{
$isMultiple = false;
if (strpos($value, ','))
$isMultiple = true;
$value = explode(',', $value);
$options = $this->getSpecificOptions($value, false);
if (!is_array($value))
$value = [$value];
$optionsText = [];
foreach ($options as $item)
if (in_array($item['value'], $value))
$optionsText[] = $this->escaper->escapeHtml($item['label']);
how i can solve this???
magento2 module array product-detail-page
magento2 module array product-detail-page
asked Feb 25 at 9:48
prabhakaran7prabhakaran7
1279
1279
What will you get in the $value ?
– aravind
Feb 25 at 10:59
don't know bro....
– prabhakaran7
Feb 25 at 11:02
From where did u call this function ? please share the code
– aravind
Feb 25 at 11:06
i did not call this function
– prabhakaran7
Feb 25 at 11:29
Have you created any attribute ? what type of attribute is that?
– aravind
Feb 25 at 11:35
|
show 3 more comments
What will you get in the $value ?
– aravind
Feb 25 at 10:59
don't know bro....
– prabhakaran7
Feb 25 at 11:02
From where did u call this function ? please share the code
– aravind
Feb 25 at 11:06
i did not call this function
– prabhakaran7
Feb 25 at 11:29
Have you created any attribute ? what type of attribute is that?
– aravind
Feb 25 at 11:35
What will you get in the $value ?
– aravind
Feb 25 at 10:59
What will you get in the $value ?
– aravind
Feb 25 at 10:59
don't know bro....
– prabhakaran7
Feb 25 at 11:02
don't know bro....
– prabhakaran7
Feb 25 at 11:02
From where did u call this function ? please share the code
– aravind
Feb 25 at 11:06
From where did u call this function ? please share the code
– aravind
Feb 25 at 11:06
i did not call this function
– prabhakaran7
Feb 25 at 11:29
i did not call this function
– prabhakaran7
Feb 25 at 11:29
Have you created any attribute ? what type of attribute is that?
– aravind
Feb 25 at 11:35
Have you created any attribute ? what type of attribute is that?
– aravind
Feb 25 at 11:35
|
show 3 more comments
1 Answer
1
active
oldest
votes
This looks like the same issue as strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 160
As mentioned on the solution of the attached link it is a magento2 bug and the code should look like the following:
public function getOptionText($value)
$isMultiple = false;
if (is_array($value))
$isMultiple = true;
$value = explode(',', $value);
$options = $this->getSpecificOptions($value, false);
if ($isMultiple)
$values = [];
foreach ($options as $item)
if (in_array($item['value'], $value))
$values[] = $item['label'];
return $values;
foreach ($options as $item)
if ($item['value'] == $value)
return $item['label'];
return false;
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%2f263265%2fwarning-strpos-expects-parameter-1-to-be-string-array-given-in-vendor-magent%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
This looks like the same issue as strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 160
As mentioned on the solution of the attached link it is a magento2 bug and the code should look like the following:
public function getOptionText($value)
$isMultiple = false;
if (is_array($value))
$isMultiple = true;
$value = explode(',', $value);
$options = $this->getSpecificOptions($value, false);
if ($isMultiple)
$values = [];
foreach ($options as $item)
if (in_array($item['value'], $value))
$values[] = $item['label'];
return $values;
foreach ($options as $item)
if ($item['value'] == $value)
return $item['label'];
return false;
add a comment |
This looks like the same issue as strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 160
As mentioned on the solution of the attached link it is a magento2 bug and the code should look like the following:
public function getOptionText($value)
$isMultiple = false;
if (is_array($value))
$isMultiple = true;
$value = explode(',', $value);
$options = $this->getSpecificOptions($value, false);
if ($isMultiple)
$values = [];
foreach ($options as $item)
if (in_array($item['value'], $value))
$values[] = $item['label'];
return $values;
foreach ($options as $item)
if ($item['value'] == $value)
return $item['label'];
return false;
add a comment |
This looks like the same issue as strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 160
As mentioned on the solution of the attached link it is a magento2 bug and the code should look like the following:
public function getOptionText($value)
$isMultiple = false;
if (is_array($value))
$isMultiple = true;
$value = explode(',', $value);
$options = $this->getSpecificOptions($value, false);
if ($isMultiple)
$values = [];
foreach ($options as $item)
if (in_array($item['value'], $value))
$values[] = $item['label'];
return $values;
foreach ($options as $item)
if ($item['value'] == $value)
return $item['label'];
return false;
This looks like the same issue as strpos() expects parameter 1 to be string, array given in vendor/magento/module-eav/Model/Entity/Attribute/Source/Table.php on line 160
As mentioned on the solution of the attached link it is a magento2 bug and the code should look like the following:
public function getOptionText($value)
$isMultiple = false;
if (is_array($value))
$isMultiple = true;
$value = explode(',', $value);
$options = $this->getSpecificOptions($value, false);
if ($isMultiple)
$values = [];
foreach ($options as $item)
if (in_array($item['value'], $value))
$values[] = $item['label'];
return $values;
foreach ($options as $item)
if ($item['value'] == $value)
return $item['label'];
return false;
answered 3 hours ago
Felipe GusmaoFelipe Gusmao
295
295
add a comment |
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%2f263265%2fwarning-strpos-expects-parameter-1-to-be-string-array-given-in-vendor-magent%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
What will you get in the $value ?
– aravind
Feb 25 at 10:59
don't know bro....
– prabhakaran7
Feb 25 at 11:02
From where did u call this function ? please share the code
– aravind
Feb 25 at 11:06
i did not call this function
– prabhakaran7
Feb 25 at 11:29
Have you created any attribute ? what type of attribute is that?
– aravind
Feb 25 at 11:35