• Resolved therealgilles

    (@chamois_blanc)


    I see this admin-only JS issue on a regular basis. It would be great to get it fixed. Thank you ??

    TypeError Cannot read properties of undefined (reading 'indexOf')
    
    (Most recent call first)
    at
    toggleCategorySelection(.../wp-content/plugins/post-expirator/assets/js/expirator-classic-editor.js:16:29)
    at
    init(.../wp-content/plugins/post-expirator/assets/js/expirator-classic-editor.js:27:9)
    at
    HTMLDocument.<anonymous>(.../wp-content/plugins/post-expirator/assets/js/expirator-classic-editor.js:7:9)
    at
    e(.../wp-admin/load-scripts.php:2:26990)
    at
    t(.../wp-admin/load-scripts.php:2:27292)
    
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Hi @chamois_blanc

    Thanks for using PublishPress Future.

    Do you mind informing us how to replicate the issue? We did not see this error on our testing.

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved. If you have any further questions, please reply again here, or you can start a new thread.

    Thanks,

    Thread Starter therealgilles

    (@chamois_blanc)

    Apologies for not replying sooner. I do not exactly know how to replicate the issue but the JS error should make it easy enough to fix this bug.

    I see this error in Rollbar. And from the error message, it happens when using the classic editor.

    The fix should be straightforward as follows:

    -        if ($(element).val().indexOf('category') !== -1) {
    +        if ($(element).val()?.indexOf('category') !== -1) {

    It’s pretty clear from the documentation that val() can return undefined:

    The?.val()?method is primarily used to get the values of form elements such as?input,?select?and?textarea. When called on an empty collection, it returns?undefined.

    Plugin Author andergmartins

    (@andergmartins)

    Hi @chamois_blanc,

    Thanks for the feedback and for suggesting a fix.
    We already implemented a fix for this which is planned to be released this week.

    Thanks

    Thread Starter therealgilles

    (@chamois_blanc)

    Much appreciated!

    Thread Starter therealgilles

    (@chamois_blanc)

    Hi @andergmartins, this is still not fixed. What happened?

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Hi @chamois_blanc

    Apologies for the delay; we couldn’t include this in the previous release. However, our goal is to incorporate it in version 3.1.4.

    For more details, you can refer to the GitHub issue here: https://github.com/publishpress/PublishPress-Future/issues/542

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Long standing Javascript problem’ is closed to new replies.