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

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

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?