• Resolved baddon250

    (@baddon250)


    I’ve been having a glitch where the icons aren’t working. I found where the glitch is and I’m not familiar with your setup, but I found where the error is occurring and it appears to be an error in your logic.

    The file is class-admin-metabox.php

    It’s failing on the if statement on line 1578 which appears to be due to conflicting if statements. The PARENT IF tests empty($this->edit_mode_value) but the CHILD IF tests array_key_exists($this->edit_mode_value, $um_icons_list) which is a clear conflict.

    Here are the values of my variables and instructions on how to reproduce the error.

    $this->edit_mode_value is null;

    $first_activation_date is empty;

    $um_icons_list is valid and is an array of all the icons.

    Once the variables are set on the Case “_icon” :

    1.) Go to the forms in the admin panel.

    2.) Click on a form, and click on an entry that would have an icon to edit.

    3.) Once the ajax popup loads, you should see a [Object object] text on the Icon Dropdown and the dropdown will fail to work.

    I have it bypassed for now, please get this taken care of when you can so I can reenable auto updates.

    • This topic was modified 1 year, 4 months ago by baddon250.
    • This topic was modified 1 year, 4 months ago by baddon250.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter baddon250

    (@baddon250)

    Heres a picture as well

    https://postimg.cc/tYRPQhLV

    Plugin Support Yurii

    (@yuriinalivaiko)

    Hello @baddon250

    There is no conflict in empty( $this->edit_mode_value ) || array_key_exists( $this->edit_mode_value, $um_icons_list ) because two statements are combined using the || operator. This operator uses left associativity. See Operator Precedence.

    Your issue may occur if there are JavaScript errors on the page or if the AJAX request that searches icons fails.

    Open the browser developer tools and look at the Console tab. Are there JavaScript errors?

    Investigate the AJAX request that searches icons if there are no errors. What do you see in the “Response” tab? Take a screenshot like this example: https://prnt.sc/Fd1pIEcNE_rh

    Thanks

    Thread Starter baddon250

    (@baddon250)

    I’ve got a lot of notes here, and about 14 hours of investigation in this so please read through this thoroughly as I’m the lead full stack developer here and it will save you some time.

    Theres no javascript errors. I checked the PHP logs and im not seeing anything other than deprecation warning logs. But other than that, the logs look clean No errors on JS Console either.

    It appears like it might be an edge case scenario, and it’s highly likely that it has something to do with that timestamp in the if statement. The timestamp is dated 7 months ago, and we noticed and responded to the issue about 5 months ago. Considering we don’t update our icons often, and at that time we started doing a big push on the members part of our site, that case make the most logical sense.

    As far as the type of error, I’m not sure how many people have reported it, but it could very well be an edge case scenario related to an update or something that was done when you to put that timestamp in the logic.

    For my case scenario, I’ve been using UM since 2017, so this is a new error that we havn’t been able to solve, but it’s tied to your logic which requires someone familiar to your architecture and what updates were done.

    But with my notes, I’ll do a run through on what I found, what I noticed, and what I potentially hypothesize.

    So far I’ve consistently seen good php logs and good js console. Nothing at all except for a deprecation error on UM related to one of your vendor dependencies, but it’s a warning warning unrelated to inputs or something bad. I have that included below.

    MY NOTES, I see that it shows “object Object”, which means that it’s kind of calling, but that it’s not using the right object key, or any key at all. Considering that this is a 2 step, where you load the form, and load the icons separately, I can observe that object Object is not failing because of the icons pulling because the icons are successfully returning in the network tab and I don’t see any wierd characters that would stop it from running, But I’ll include the content below for verification. But that’s not where the problem is happening. The dropdown should say something like Email with an email icon next to it, but instead it’s showing object Object, which lead me to believe that the issue is not selecting the right method or element on the Object, and it displays the object, rather than the value. Because I can see that the js is getting the icons on the html, if I search the html, I can find them and manually set the height of the select2 container to be able to see it, but that doesn’t fix it. I tried checking for conflicting non UM select2 and there was 2 total files, they were related to my app plugin, I disabled both and double checked the html that they were gone, and the script still didn’t work. But if there was a problem and we’ve had select2 problems in the past, there would have been an error related to this, which supports my last point that the error very likely relates to an improperly selected object key or something like that. Again, I don’t know your architecture, but I do see that timestamp, and I’m not sure if that time stamp is in other areas related to the same purpose, and I’m not sure if that timestamp has to do with variably choosing the object selector, but It’s something to be considered. I do have screenshots attached to be able to help as much as possible as we are trying to get this fixed before we do a hard launch next month. And if you need anything else, or have development specific questions, Please let me know. Here’s all the info I have for now.

    Also a Note: I just checked out the return on the onclick of a form input, screenshot is attached. When the ajax comes back it’s coming back in raw html. We’ve had problems in the past doing this and we’ve had unexpected errors from it. We tend to encode in json or something comparable before sending it over to help prevent the html potentially escaping or causing unexpected behavior in js.

    DEPRECATED ERROR LOG RELATED TO UM (Likely Insignificant)

    [06-Dec-2024 18:38:22 UTC] PHP Deprecated: Optional parameter $type declared before required parameter $field_id is implicitly treated as a required parameter in /mnt/BLOCKSTORAGE/home/1188745.cloudwaysapps.com/bjhcjpavcz/public_html/wp-content/plugins/um-gallery-pro/vendor/webdevstudios/cmb2/includes/rest-api/CMB2_REST.php on line 693

    SCREENSHOT OF CONSOLE LOOKS FINE (same on both form input click and icon dropdown click)

    View post on imgur.com

    SCREENSHOT OF AJAX CALL VIA ICON DROPDOWN CLICK LOOKS FINE

    View post on imgur.com

    *IMPORTANT SCREENSHOT OF AJAX CALL VIA FORM FIELD CLICK POTENTIALLY HAZARDOUS. Contains raw html that can potentially escape the js.

    View post on imgur.com

    *IMPORTANT SCREENSHOT OF FORCED SELECT2 POSITION. w/ notes

    View post on imgur.com

    SCREENSHOT OF THE DATE THAT I FIRST POSTED ON THIS ISSUE AFTER I FOUND IT

    View post on imgur.com

    COPY / PASTE of icons return value, likely insignificant.

    {
    "success": true,
    "data": {
    "icons": {
    "fas fa-0": {
    "label": "0",
    "search": [
    "Digit Zero",
    "nada",
    "none",
    "zero",
    "zilch",
    "0"
    ]
    },
    "fas fa-1": {
    "label": "1",
    "search": [
    "Digit One",
    "one",
    "1"
    ]
    },
    "fas fa-2": {
    "label": "2",
    "search": [
    "Digit Two",
    "two",
    "2"
    ]
    },
    "fas fa-3": {
    "label": "3",
    "search": [
    "Digit Three",
    "three",
    "3"
    ]
    },
    "fas fa-4": {
    "label": "4",
    "search": [
    "Digit Four",
    "four",
    "4"
    ]
    },
    "fas fa-5": {
    "label": "5",
    "search": [
    "Digit Five",
    "five",
    "5"
    ]
    },
    "fas fa-6": {
    "label": "6",
    "search": [
    "Digit Six",
    "six",
    "6"
    ]
    },
    "fas fa-7": {
    "label": "7",
    "search": [
    "Digit Seven",
    "seven",
    "7"
    ]
    },
    "fas fa-8": {
    "label": "8",
    "search": [
    "Digit Eight",
    "eight",
    "8"
    ]
    },
    "fas fa-9": {
    "label": "9",
    "search": [
    "Digit Nine",
    "nine",
    "9"
    ]
    },
    "fab fa-42-group": {
    "label": "42.group",
    "search": [
    "42-group",
    "42.group"
    ]
    },
    "fab fa-500px": {
    "label": "500px",
    "search": [
    "500px"
    ]
    },
    "fas fa-a": {
    "label": "A",
    "search": [
    "Latin Capital Letter A",
    "Latin Small Letter A",
    "letter",
    "a"
    ]
    },
    "fab fa-accessible-icon": {
    "label": "Accessible Icon",
    "search": [
    "accessibility",
    "disabled",
    "handicap",
    "person",
    "uer",
    "wheelchair",
    "wheelchair-alt",
    "accessible-icon",
    "accessible icon"
    ]
    },
    "fab fa-accusoft": {
    "label": "Accusoft",
    "search": [
    "accusoft"
    ]
    },
    "fas fa-address-book": {
    "label": "Address Book (solid)",
    "search": [
    "contact",
    "directory",
    "employee",
    "index",
    "little black book",
    "portfolio",
    "rolodex",
    "uer",
    "username",
    "address-book",
    "address book"
    ]
    },
    "far fa-address-book": {
    "label": "Address Book (regular)",
    "search": [
    "contact",
    "directory",
    "employee",
    "index",
    "little black book",
    "portfolio",
    "rolodex",
    "uer",
    "username",
    "address-book",
    "address book"
    ]
    },
    "fas fa-address-card": {
    "label": "Address Card (solid)",
    "search": [
    "about",
    "contact",
    "employee",
    "id",
    "identification",
    "portfolio",
    "postcard",
    "profile",
    "registration",
    "uer",
    "username",
    "address-card",
    "address card"
    ]
    },
    "far fa-address-card": {
    "label": "Address Card (regular)",
    "search": [
    "about",
    "contact",
    "employee",
    "id",
    "identification",
    "portfolio",
    "postcard",
    "profile",
    "registration",
    "uer",
    "username",
    "address-card",
    "address card"
    ]
    },
    "fab fa-adn": {
    "label": "App.net",
    "search": [
    "adn",
    "app.net"
    ]
    },
    "fab fa-adversal": {
    "label": "Adversal",
    "search": [
    "adversal"
    ]
    },
    "fab fa-affiliatetheme": {
    "label": "affiliatetheme",
    "search": [
    "affiliatetheme"
    ]
    },
    "fab fa-airbnb": {
    "label": "Airbnb",
    "search": [
    "airbnb"
    ]
    },
    "fab fa-algolia": {
    "label": "Algolia",
    "search": [
    "algolia"
    ]
    },
    "fas fa-align-center": {
    "label": "Align Center",
    "search": [
    "format",
    "middle",
    "paragraph",
    "text",
    "align-center",
    "align center"
    ]
    },
    "fas fa-align-justify": {
    "label": "Align Justify",
    "search": [
    "format",
    "paragraph",
    "text",
    "align-justify",
    "align justify"
    ]
    },
    "fas fa-align-left": {
    "label": "Align Left",
    "search": [
    "format",
    "paragraph",
    "text",
    "align-left",
    "align left"
    ]
    },
    "fas fa-align-right": {
    "label": "Align Right",
    "search": [
    "format",
    "paragraph",
    "text",
    "align-right",
    "align right"
    ]
    },
    "fab fa-alipay": {
    "label": "Alipay",
    "search": [
    "alipay"
    ]
    },
    "fab fa-amazon": {
    "label": "Amazon",
    "search": [
    "amazon"
    ]
    },
    "fab fa-amazon-pay": {
    "label": "Amazon Pay",
    "search": [
    "amazon-pay",
    "amazon pay"
    ]
    },
    "fab fa-amilia": {
    "label": "Amilia",
    "search": [
    "amilia"
    ]
    },
    "fas fa-anchor": {
    "label": "Anchor",
    "search": [
    "anchor",
    "berth",
    "boat",
    "dock",
    "embed",
    "link",
    "maritime",
    "moor",
    "port",
    "secure",
    "ship",
    "tool"
    ]
    },
    "fas fa-anchor-circle-check": {
    "label": "Anchor Circle Check",
    "search": [
    "enable",
    "marina",
    "not affected",
    "ok",
    "okay",
    "port",
    "validate",
    "working",
    "anchor-circle-check",
    "anchor circle check"
    ]
    },
    "fas fa-anchor-circle-exclamation": {
    "label": "Anchor Circle Exclamation",
    "search": [
    "affected",
    "failed",
    "marina",
    "port",
    "anchor-circle-exclamation",
    "anchor circle exclamation"
    ]
    },
    "fas fa-anchor-circle-xmark": {
    "label": "Anchor Circle Xmark",
    "search": [
    "destroy",
    "marina",
    "port",
    "uncheck",
    "anchor-circle-xmark",
    "anchor circle xmark"
    ]
    },
    "fas fa-anchor-lock": {
    "label": "Anchor Lock",
    "search": [
    "closed",
    "lockdown",
    "marina",
    "padlock",
    "port",
    "privacy",
    "quarantine",
    "anchor-lock",
    "anchor lock"
    ]
    },
    "fab fa-android": {
    "label": "Android",
    "search": [
    "robot",
    "android"
    ]
    },
    "fab fa-angellist": {
    "label": "AngelList",
    "search": [
    "angellist"
    ]
    },
    "fas fa-angle-down": {
    "label": "Angle Down",
    "search": [
    "Down Arrowhead",
    "arrow",
    "caret",
    "download",
    "expand",
    "insert",
    "angle-down",
    "angle down"
    ]
    },
    "fas fa-angle-left": {
    "label": "Angle Left",
    "search": [
    "Single Left-Pointing Angle Quotation Mark",
    "arrow",
    "back",
    "caret",
    "less",
    "previous",
    "angle-left",
    "angle left"
    ]
    },
    "fas fa-angle-right": {
    "label": "Angle Right",
    "search": [
    "Single Right-Pointing Angle Quotation Mark",
    "arrow",
    "care",
    "forward",
    "more",
    "next",
    "angle-right",
    "angle right"
    ]
    },
    "fas fa-angle-up": {
    "label": "Angle Up",
    "search": [
    "Up Arrowhead",
    "arrow",
    "caret",
    "collapse",
    "upgrade",
    "upload",
    "angle-up",
    "angle up"
    ]
    },
    "fas fa-angles-down": {
    "label": "Angles Down",
    "search": [
    "arrows",
    "caret",
    "download",
    "expand",
    "angles-down",
    "angles down"
    ]
    },
    "fas fa-angles-left": {
    "label": "Angles Left",
    "search": [
    "Left-Pointing Double Angle Quotation Mark",
    "arrows",
    "back",
    "caret",
    "laquo",
    "previous",
    "quote",
    "angles-left",
    "angles left"
    ]
    },
    "fas fa-angles-right": {
    "label": "Angles Right",
    "search": [
    "Right-Pointing Double Angle Quotation Mark",
    "arrows",
    "caret",
    "forward",
    "more",
    "next",
    "quote",
    "raquo",
    "angles-right",
    "angles right"
    ]
    },
    "fas fa-angles-up": {
    "label": "Angles Up",
    "search": [
    "arrows",
    "caret",
    "collapse",
    "upload",
    "angles-up",
    "angles up"
    ]
    },
    "fab fa-angrycreative": {
    "label": "Angry Creative",
    "search": [
    "angrycreative",
    "angry creative"
    ]
    },
    "fab fa-angular": {
    "label": "Angular",
    "search": [
    "angular"
    ]
    },
    "fas fa-ankh": {
    "label": "Ankh",
    "search": [
    "Ankh",
    "amulet",
    "copper",
    "coptic christianity",
    "copts",
    "crux ansata",
    "egypt",
    "venus",
    "ankh"
    ]
    }
    },
    "total_count": 2045
    }
    }
    • This reply was modified 1 year, 4 months ago by baddon250.
    • This reply was modified 1 year, 4 months ago by baddon250.
    Plugin Support Yurii

    (@yuriinalivaiko)

    Hello @baddon250

    Thanks for testing and providing details. Now we can be sure that this is not a server error and the ajax request works correctly.

    As you suggested, this problem may be related to the select2 library. It is possible that a third-party plugin is loading a different version of the library, replacing ours. There was a similar problem with tooltips in the past. A third-party plugin that has nothing to do with Ultimate Member loaded a different version of the tooltips library onto the form edit page.

    Could you please verify a path to the select2 file?
    It should be /wp-content/plugins/ultimate-member/assets/libs/select2/select2.full.js

    Please also check who initializes the select2 function of the “Icon” field.
    It should be line 98 in the file /wp-content/plugins/ultimate-member/assets/js/admin/common.js
    See this screenshot: https://prnt.sc/hz7tfvo2WuTs

    Regards

    Thread Starter baddon250

    (@baddon250)

    I found out what the glitch was, You were right. It was select 2. However, it’s something you might want to put an unload on in your app because it’s woocommerce. They renamed the file selectWoo. Dumb right?

    Could you please add unloads to these 2 file locations in your plugin in future updates.

    WOOCOMMERCE

    DOMAIN/wp-content/plugins/woocommerce/assets/js/selectWoo/selectWoo.full.min.js

    MOBILOUD

    https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js

    Plugin Support Yurii

    (@yuriinalivaiko)

    Hello @baddon250

    We know that the selectWoo script conflicts with the select2 script on the front-end. We solved this conflict in our extension for integration.

    WooCommerce plugin does not load the selectWoo script in the wp-admin area on the “Form Edit” page, so this conflict does not occur, see https://prnt.sc/Cygjv7X-uOj4. Perhaps another plugin (some WooCommerce add-on) loads this script without a screen ID verification.

    Could you try this code snippet? I’m not sure if this code will solve your problem because I can’t reproduce the issue. But this is what helps to solve a conflict on the front-end.

    // Enqueue the "select2" script earlier to avoid a conflict with "selectWoo".
    add_action( 'admin_enqueue_scripts', 'um_fix_selectWoo_conflict' );
    add_action( 'wp_enqueue_scripts', 'um_fix_selectWoo_conflict' );
    function um_fix_selectWoo_conflict() {
    if ( wp_script_is( 'select2' ) && wp_script_is( 'selectWoo' ) ) {
    $wp_scripts = wp_scripts();
    if ( ! in_array( 'select2', $wp_scripts->queue, true ) && isset( $wp_scripts->registered[ 'select2' ] ) ) {
    array_unshift( $wp_scripts->queue, 'select2' );
    $wp_scripts->add_data( 'selectWoo', 'group', 1 );
    $wp_scripts->add_data( 'selectWoo', 'strategy', 'defer' );
    }
    }
    }

    Regards

    Plugin Support Yurii

    (@yuriinalivaiko)

    Hi @baddon250

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help.

    Regards

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘GLITCH FOUND’ is closed to new replies.