Uncaught TypeError: Cannot read property 'apply' of undefined at Function.ko.observableArray.fn.(anonymous function) [as push]Magento 2 - jsError - Cannot read property 'autocomplete' of undefinedCannot read property `scopeLabel` of undefined on Product Detail PageKnockoutJS cannot read property 'fromJS' of undefinedMagento 2: Uncaught TypeError: Cannot read property '*' of undefined in (section-config.js:33)Cannot read property 'RFC_2822' of undefinedjQuery UI breaks when clicking on draggable element: “Cannot read property 'defaultView' of undefined”Uncaught TypeError: Cannot read property 'top' of undefined at step-navigator.jsPassword Strength Meter - Uncaught TypeError: Cannot read property 'toLowerCase' of undefinedMagento 2.3 | Knockout.js - Unexpected end of inputMagento 2.2.5 - Uncaught TypeError: Cannot read property 'dialog' of undefined

1025th term of the given sequence.

How did pilots avoid thunderstorms and related weather before “reliable” airborne weather radar was introduced on airliners?

Found more old paper shares from broken up companies

Is there an English word to describe when a sound "protrudes"?

Book in which the "mountain" in the distance was a hole in the flat world

Why Lie algebras if what we care about in physics are groups?

Oriented vector bundle with odd-dimensional fibers

Can "Taking algebraic closure" be made into a functor?

What does the following chess proverb mean: "Chess is a sea where a gnat may drink from and an elephant may bathe in."

Plotting maxima within a simplex

Count the identical pairs in two lists

How to handle not being able to attend as often as I'd like

Reissue US, UK, Canada visas in stolen passports

Why does the salt in the oceans not sink to the bottom?

What does a Nintendo Game Boy do when turned on without a game cartridge inserted?

Calculating Fibonacci sequence in several different ways

How does mathematics work?

What kind of curve (or model) should I fit to my percentage data?

As the Ferris wheel turns

How can I remove studs and screws from the inside of drywall when installing a pocket door without needing to do paint and patch work on both sides?

Function pointer parameter without asterisk

Is there any direct train from LHR Airport to Newcastle Gateshead?

Why are Oscar, India, and X-Ray (O, I, and X) not used as taxiway identifiers?

Has Iron Man made any suit for underwater combat?



Uncaught TypeError: Cannot read property 'apply' of undefined at Function.ko.observableArray.fn.(anonymous function) [as push]


Magento 2 - jsError - Cannot read property 'autocomplete' of undefinedCannot read property `scopeLabel` of undefined on Product Detail PageKnockoutJS cannot read property 'fromJS' of undefinedMagento 2: Uncaught TypeError: Cannot read property '*' of undefined in (section-config.js:33)Cannot read property 'RFC_2822' of undefinedjQuery UI breaks when clicking on draggable element: “Cannot read property 'defaultView' of undefined”Uncaught TypeError: Cannot read property 'top' of undefined at step-navigator.jsPassword Strength Meter - Uncaught TypeError: Cannot read property 'toLowerCase' of undefinedMagento 2.3 | Knockout.js - Unexpected end of inputMagento 2.2.5 - Uncaught TypeError: Cannot read property 'dialog' of undefined






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4















I have created a custom attribute(multiselect) for product with the same filter type as category selection on Magento 2. Attribute selection is working fine when creating a new product however it is not working on edit form. I have noticed below error from knockout js on console.



knockout.js:1449 Uncaught TypeError: Cannot read property 'apply' of undefined at Function.ko.observableArray.fn.(anonymous function) [as push]



Also I have attached the screenshots of the error I am facing.
Add productError



A help to fix this issue would be much appreciated.










share|improve this question






















  • any luck? i had the same after magento upgrade 2.2.2

    – Antonio Pedicini
    Dec 28 '17 at 14:14

















4















I have created a custom attribute(multiselect) for product with the same filter type as category selection on Magento 2. Attribute selection is working fine when creating a new product however it is not working on edit form. I have noticed below error from knockout js on console.



knockout.js:1449 Uncaught TypeError: Cannot read property 'apply' of undefined at Function.ko.observableArray.fn.(anonymous function) [as push]



Also I have attached the screenshots of the error I am facing.
Add productError



A help to fix this issue would be much appreciated.










share|improve this question






















  • any luck? i had the same after magento upgrade 2.2.2

    – Antonio Pedicini
    Dec 28 '17 at 14:14













4












4








4








I have created a custom attribute(multiselect) for product with the same filter type as category selection on Magento 2. Attribute selection is working fine when creating a new product however it is not working on edit form. I have noticed below error from knockout js on console.



knockout.js:1449 Uncaught TypeError: Cannot read property 'apply' of undefined at Function.ko.observableArray.fn.(anonymous function) [as push]



Also I have attached the screenshots of the error I am facing.
Add productError



A help to fix this issue would be much appreciated.










share|improve this question














I have created a custom attribute(multiselect) for product with the same filter type as category selection on Magento 2. Attribute selection is working fine when creating a new product however it is not working on edit form. I have noticed below error from knockout js on console.



knockout.js:1449 Uncaught TypeError: Cannot read property 'apply' of undefined at Function.ko.observableArray.fn.(anonymous function) [as push]



Also I have attached the screenshots of the error I am facing.
Add productError



A help to fix this issue would be much appreciated.







magento2 knockoutjs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 9 '17 at 5:05









user50326user50326

211 bronze badge




211 bronze badge












  • any luck? i had the same after magento upgrade 2.2.2

    – Antonio Pedicini
    Dec 28 '17 at 14:14

















  • any luck? i had the same after magento upgrade 2.2.2

    – Antonio Pedicini
    Dec 28 '17 at 14:14
















any luck? i had the same after magento upgrade 2.2.2

– Antonio Pedicini
Dec 28 '17 at 14:14





any luck? i had the same after magento upgrade 2.2.2

– Antonio Pedicini
Dec 28 '17 at 14:14










1 Answer
1






active

oldest

votes


















0














The reason this probably fails is because you are retrieving data from database as a string.



You should edit your DataProvider ( Namespace/Module/Model/Test/DataProvider.php ) and change the getData() method with something like



foreach ($items as $test) 
...
$this->loadedData[$test->getId()] = $test->getData();
$customAttributes = ['Test1', 'Test2']; // here you should do your own retrieving of data from the database
$this->loadedData[$test->getId()]['custom_attribute'] = $customAttributes;
...
return $this->loadedData;



This did the trick for me because I add the multiselect in a UI component that relies on a DataProvider.






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%2f192599%2funcaught-typeerror-cannot-read-property-apply-of-undefined-at-function-ko-obs%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














    The reason this probably fails is because you are retrieving data from database as a string.



    You should edit your DataProvider ( Namespace/Module/Model/Test/DataProvider.php ) and change the getData() method with something like



    foreach ($items as $test) 
    ...
    $this->loadedData[$test->getId()] = $test->getData();
    $customAttributes = ['Test1', 'Test2']; // here you should do your own retrieving of data from the database
    $this->loadedData[$test->getId()]['custom_attribute'] = $customAttributes;
    ...
    return $this->loadedData;



    This did the trick for me because I add the multiselect in a UI component that relies on a DataProvider.






    share|improve this answer



























      0














      The reason this probably fails is because you are retrieving data from database as a string.



      You should edit your DataProvider ( Namespace/Module/Model/Test/DataProvider.php ) and change the getData() method with something like



      foreach ($items as $test) 
      ...
      $this->loadedData[$test->getId()] = $test->getData();
      $customAttributes = ['Test1', 'Test2']; // here you should do your own retrieving of data from the database
      $this->loadedData[$test->getId()]['custom_attribute'] = $customAttributes;
      ...
      return $this->loadedData;



      This did the trick for me because I add the multiselect in a UI component that relies on a DataProvider.






      share|improve this answer

























        0












        0








        0







        The reason this probably fails is because you are retrieving data from database as a string.



        You should edit your DataProvider ( Namespace/Module/Model/Test/DataProvider.php ) and change the getData() method with something like



        foreach ($items as $test) 
        ...
        $this->loadedData[$test->getId()] = $test->getData();
        $customAttributes = ['Test1', 'Test2']; // here you should do your own retrieving of data from the database
        $this->loadedData[$test->getId()]['custom_attribute'] = $customAttributes;
        ...
        return $this->loadedData;



        This did the trick for me because I add the multiselect in a UI component that relies on a DataProvider.






        share|improve this answer













        The reason this probably fails is because you are retrieving data from database as a string.



        You should edit your DataProvider ( Namespace/Module/Model/Test/DataProvider.php ) and change the getData() method with something like



        foreach ($items as $test) 
        ...
        $this->loadedData[$test->getId()] = $test->getData();
        $customAttributes = ['Test1', 'Test2']; // here you should do your own retrieving of data from the database
        $this->loadedData[$test->getId()]['custom_attribute'] = $customAttributes;
        ...
        return $this->loadedData;



        This did the trick for me because I add the multiselect in a UI component that relies on a DataProvider.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 26 '18 at 10:55









        tuxilinatuxilina

        1




        1



























            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%2f192599%2funcaught-typeerror-cannot-read-property-apply-of-undefined-at-function-ko-obs%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

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form