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















 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???










share|improve this question






















  • 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















-1















 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???










share|improve this question






















  • 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













-1












-1








-1








 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???










share|improve this question














 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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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

















  • 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










1 Answer
1






active

oldest

votes


















0














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;






share|improve this answer






















    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    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;






    share|improve this answer



























      0














      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;






      share|improve this answer

























        0












        0








        0







        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;






        share|improve this answer













        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;







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 3 hours ago









        Felipe GusmaoFelipe Gusmao

        295




        295



























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

            Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр

            Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»