The select2('open') method was called on an element that is not using Select2

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
guillerbm7
User
Posts: 17

The select2('open') method was called on an element that is not using Select2

Post by guillerbm7 »

Hi! I'm migrating an small web from PHPMaker v2023 to v2024, but my filters won't work. When I click on them, nothing happens and the console returns me this:

The select2('open') method was called on an element that is not using Select2. select2.full.js:6481:20
jQuery 4
filter ew.js:5631
<anonymous> ew.js:10149
jQuery 8
<anonymous> CardRefresh.js:157
<anonymous> adminlte.min.js:6
<anonymous> adminlte.min.js:6

Anyone have some clue?


arbei
User
Posts: 9719

Post by arbei »

According to your error message, you are using Select2 in CardRefresh? Is it your own code or generated from original template? If latter, what is the page? A dashboard including a report with table head filter?


guillerbm7
User
Posts: 17

Post by guillerbm7 »

It is a table list and I'm using a filter for some fields, it's not my code, it's generated. The filters don't work at all.


arbei
User
Posts: 9719

Post by arbei »

But there is no CardRefresh.js in List page for normal tables. You may post the complete error trace from the Console panel of your browser.


arbei
User
Posts: 9719

Post by arbei »

arbei wrote:

You may post the complete error trace from the Console panel of your browser.

Press F12 in your browser, go to the Console panel, click the error, you'll see the complete stack trace, copy and post it here.

You may also see Copy stack trace.


guillerbm7
User
Posts: 17

Post by guillerbm7 »

In my console there are 2 errors. The first one is the one I show above:

*The select2('open') method was called on an element that is not using Select2. select2.full.js:6481:20
    jQuery 4
        select2
        each
        each
        select2
    filter ew.js:5631
    <anonymous> ew.js:10149
    jQuery 8
        dispatch
        handle
    (Asíncrono: EventListener.handleEvent)
        add
        Le
        each
        each
        Le
        on
    <anonymous> CardRefresh.js:157
    <anonymous> adminlte.min.js:6
    <anonymous> adminlte.min.js:6*

And the second one I think is consequence of the first one:

*Uncaught TypeError: can't access property "open", e is undefined
    jQuery 4
        select2
        each
        each
        select2
    filter ew.js:5631
    <anonymous> ew.js:10149
    jQuery 8
        dispatch
        handle
        add
        Le
        each
        each
        Le
        on
    <anonymous> CardRefresh.js:157
    <anonymous> adminlte.min.js:6
    <anonymous> adminlte.min.js:6
select2.full.js:6487:10
    jQuery 4
        select2
        each
        each
        select2
    filter ew.js:5631
    <anonymous> ew.js:10149
    jQuery 8
        dispatch
        handle
    (Asíncrono: EventListener.handleEvent)
        add
        Le
        each
        each
        Le
        on
    <anonymous> CardRefresh.js:157
    <anonymous> adminlte.min.js:6
    <anonymous> adminlte.min.js:6
*

arbei
User
Posts: 9719

Post by arbei »

The info is not more detailed than your first post. Anyway,

guillerbm7 wrote:

<anonymous> CardRefresh.js:157

The source code is:

$(document).on('click', SELECTOR_DATA_REFRESH, function (event) { // where  SELECTOR_DATA_REFRESH = '[data-card-widget="card-refresh"]'

That means there was a click on a CardRefresh widget.

However, as said, there is no CardRefresh widget in normal table List page at all. CardRefresh is only used in dashboard report and login pages. That's why I asked if it is a dashboard report or your own code.

You better view the HTML source of your page in your browser and look for "CardRefresh", try to find out where the error orginated.

If you have added any customizations (not from the original template), you may want to elaborate.


guillerbm7
User
Posts: 17

Post by guillerbm7 »

Hi again. The last couple of days I've been trying to find out where do CardRefresh came from or some clues about the error but without success. Yet, I've found an error that pops up when I open the code section of any table/view in the PHPMaker app. It says:

There was an error creating the controller. (2)
Error code: 0x80070002
Unexpected error result.

It may be that the .pmp file has been corrupted?


arbei
User
Posts: 9719

Post by arbei »

That is irrelevant to JavaScript errors.

arbei wrote:

You better view the HTML source of your page in your browser and look for "CardRefresh", try to find out where the error orginated.
If you have added any customizations (not from the original template), you may want to elaborate.


Post Reply