Support » Plugin: Calculated fields for ACF » Error message: Empty needle

  • Resolved bbr13

    (@bbr13)


    Hi,
    I have in ACF Group 3 fields (number) : a b c
    In c in the “formula” : a+b
    The result is ok but frontend and backend is displayd the following error message :
    Warning: strpos(): Empty needle in …\wp-content\plugins\calculated-fields-for-acf\src\Fields.php on line 257
    Can you, please, tell me if it is du to your plugin or a setting I set wrong.
    Regards,
    Bruno

    • This topic was modified 1 year, 5 months ago by bbr13.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author wundermatics

    (@wundermatics)

    Hi bbr13,

    That’s a bug for sure.

    To reproduce your error, I’d appreciate if I could see your fields definitions. Please make an export (in json format) and paste it here, that help a lot when trouble shooting.

    Many thanks in advance,

    I have the same issue and when you press update it says:

    Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/calculated-fields-for-acf/src/Fields.php on line 80

    I just encountered this error as well.

    I can’t speak for the others, but after playing around with it, it appears to be a conflict with the plugin ” Advanced Custom Fields: Extended“.

    I setup a group and within that group are 3 fields:
    cost_per_item (number type)
    number_of_items (number type)
    total_cost (text type, formula is: cost_per_item*number_of_items )

    If that group is at the “top layer”, I don’t get the error message.

    If I tuck the group within another layer field type (like a tab or accordion), then I get the error message.

    Hopefully that helps narrow it down a little more. If you’re looking for something specific, let me know and I’ll provide you with what I can.

    Hello!

    ACF Extended developer here. @jp3 can you please provide some more information about that conflict between “Calculated fields for ACF” & “ACF Extended”?

    – Can you export your field group json?
    – Can you tell us the error message you’re seeing?

    Thanks in advance.

    Regards.

    webdesgnr14

    (@webdesgnr14)

    Hey!

    I’m also having this issue!
    Error Message:
    Warning: strpos(): Empty needle in /var/www/html/wp-content/plugins/calculated-fields-for-acf/src/Fields.php on line 247

    Field Group JSON:

    [
        {
            "key": "group_5f232eb03c469",
            "title": "Site Options",
            "fields": [
                {
                    "key": "field_5f232ee8abdd3",
                    "label": "Processing Solutions Menu",
                    "name": "",
                    "type": "tab",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "placement": "top",
                    "endpoint": 0
                },
                {
                    "key": "field_5f232f10abdd4",
                    "label": "Menu Items",
                    "name": "menu_items",
                    "type": "repeater",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "collapsed": "field_5f233075abdd9",
                    "min": 0,
                    "max": 6,
                    "layout": "block",
                    "button_label": "",
                    "sub_fields": [
                        {
                            "key": "field_5f23305dabdd8",
                            "label": "Image",
                            "name": "image",
                            "type": "image",
                            "instructions": "Select an image to display with your menu item.",
                            "required": 0,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "return_format": "array",
                            "preview_size": "thumbnail",
                            "library": "all",
                            "min_width": "",
                            "min_height": "",
                            "min_size": "",
                            "max_width": "",
                            "max_height": "",
                            "max_size": "",
                            "mime_types": "png, svg"
                        },
                        {
                            "key": "field_5f233075abdd9",
                            "label": "Heading",
                            "name": "heading",
                            "type": "text",
                            "instructions": "Input the menu item title or heading. Ex: Terminal Processing",
                            "required": 0,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "default_value": "",
                            "placeholder": "",
                            "prepend": "",
                            "append": "",
                            "maxlength": ""
                        },
                        {
                            "key": "field_5f233088abdda",
                            "label": "Description",
                            "name": "description",
                            "type": "text",
                            "instructions": "Input the menu item's description, you may do so by using a paragraph or list.",
                            "required": 0,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "default_value": "This is a sentence about this clover product.",
                            "placeholder": "",
                            "prepend": "",
                            "append": "",
                            "maxlength": ""
                        },
                        {
                            "key": "field_5f236406758f7",
                            "label": "Page Link",
                            "name": "page",
                            "type": "page_link",
                            "instructions": "Select a page for this menu item to link to.",
                            "required": 1,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "post_type": "",
                            "taxonomy": "",
                            "allow_null": 0,
                            "allow_archives": 0,
                            "multiple": 0
                        }
                    ]
                },
                {
                    "key": "field_5f237de705594",
                    "label": "General\/Contact Info",
                    "name": "",
                    "type": "tab",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "placement": "top",
                    "endpoint": 0
                },
                {
                    "key": "field_5f492f2f1127d",
                    "label": "Address",
                    "name": "address",
                    "type": "group",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "layout": "block",
                    "sub_fields": [
                        {
                            "key": "field_5f492f571127e",
                            "label": "Address 1",
                            "name": "address_1",
                            "type": "text",
                            "instructions": "",
                            "required": 0,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "formula": "",
                            "readonly": 0,
                            "default_value": "",
                            "placeholder": "777 Lucky Street",
                            "prepend": "",
                            "append": "",
                            "maxlength": ""
                        },
                        {
                            "key": "field_5f492f611127f",
                            "label": "Address 2",
                            "name": "address_2",
                            "type": "text",
                            "instructions": "",
                            "required": 0,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "formula": "",
                            "readonly": 0,
                            "default_value": "",
                            "placeholder": "Suite 777",
                            "prepend": "",
                            "append": "",
                            "maxlength": ""
                        },
                        {
                            "key": "field_5f492fec11282",
                            "label": "City",
                            "name": "city",
                            "type": "text",
                            "instructions": "",
                            "required": 0,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "formula": "",
                            "readonly": 0,
                            "default_value": "",
                            "placeholder": "Orlando",
                            "prepend": "",
                            "append": "",
                            "maxlength": ""
                        },
                        {
                            "key": "field_5f492f6911280",
                            "label": "State",
                            "name": "state",
                            "type": "select",
                            "instructions": "",
                            "required": 0,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "formula": "",
                            "readonly": 0,
                            "choices": {
                                "AL": "Alabama",
                                "AK": "Alaska",
                                "AZ": "Arizona",
                                "AR": "Arkansas",
                                "CA": "California",
                                "CO": "Colorado",
                                "CT": "Connecticut",
                                "DE": "Delaware",
                                "DC": "District of Colombia",
                                "FL": "Florida",
                                "GA": "Georgia",
                                "HI": "Hawaii",
                                "ID": "Idaho",
                                "IL": "Illinois",
                                "IN": "Indiana",
                                "IA": "Iowa",
                                "KS": "Kansas",
                                "KY": "Kentucky",
                                "LA": "Louisiana",
                                "ME": "Maine",
                                "MD": "Maryland",
                                "MA": "Massachusetts",
                                "MI": "Michigan",
                                "MN": "Minnesota",
                                "MS": "Mississippi",
                                "MO": "Missouri",
                                "MT": "Montana",
                                "NE": "Nebraska",
                                "NV": "Nevada",
                                "NH": "New Hampshire",
                                "NJ": "New Jersey",
                                "NM": "New Mexico",
                                "NY": "New York",
                                "NC": "North Carolina",
                                "ND": "North Dakota",
                                "OH": "Ohio",
                                "OK": "Oklahoma",
                                "OR": "Oregon",
                                "PA": "Pennsylvania",
                                "PR": "Puerto Rico",
                                "RI": "Rhode Island",
                                "SC": "South Carolina",
                                "SD": "South Dakota",
                                "TN": "Tennessee",
                                "TX": "Texas",
                                "UT": "Utah",
                                "VT": "Vermont",
                                "VA": "Virginia",
                                "WA": "Washington",
                                "WV": "West Virginia",
                                "WI": "Wisconsin",
                                "WY": "Wyoming"
                            },
                            "default_value": "FL",
                            "allow_null": 0,
                            "multiple": 0,
                            "ui": 0,
                            "return_format": "value",
                            "ajax": 0,
                            "placeholder": ""
                        },
                        {
                            "key": "field_5f492f8111281",
                            "label": "Zipcode",
                            "name": "zipcode",
                            "type": "text",
                            "instructions": "",
                            "required": 0,
                            "conditional_logic": 0,
                            "wrapper": {
                                "width": "",
                                "class": "",
                                "id": ""
                            },
                            "formula": "",
                            "readonly": 0,
                            "default_value": "",
                            "placeholder": 77777,
                            "prepend": "",
                            "append": "",
                            "maxlength": ""
                        }
                    ]
                },
                {
                    "key": "field_5f237e0e05595",
                    "label": "Sales Phone",
                    "name": "sales_phone",
                    "type": "text",
                    "instructions": "Input the phone number used to contact your sales team",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "default_value": "1-877-977-0598",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "maxlength": ""
                },
                {
                    "key": "field_5f43cb249d086",
                    "label": "Contact\/Phone Block Message",
                    "name": "message",
                    "type": "text",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "maxlength": ""
                },
                {
                    "key": "field_5f237f5b145de",
                    "label": "Get Pricing",
                    "name": "get_pricing",
                    "type": "link",
                    "instructions": "Select the start page of the Get Pricing Funnel.",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "return_format": "array"
                },
                {
                    "key": "field_5f761a1969bb5",
                    "label": "Get Pricing Button Mobile Text",
                    "name": "get_pricing_btn_mobile_text",
                    "type": "text",
                    "instructions": "Input alternative text for the get pricing button on mobile devices.",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "Pricing",
                    "placeholder": "Pricing",
                    "prepend": "",
                    "append": "",
                    "maxlength": ""
                },
                {
                    "key": "field_5f283abc2fc31",
                    "label": "Privacy Statement",
                    "name": "privacy_statement",
                    "type": "textarea",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "default_value": "National Bankcard, Inc. is a registered ISO of Compass Bank an Alabama State Chartered Bank. The Clover trademark and logo are owned by Clover Network, Inc., a First Data company. All other trademarks, service marks and trade names referenced in this material are the property of their respective owners. Apple, the Apple logo, and iPhone are trademarks of Apple Inc., registered in the U.S. and other countries. Android is a trademark of Google, Inc. EMV is a registered mark owned by EMVCo LLC. Next day funding is based on financial condition of merchant's business at time of approval.\r\n* Offer available for a limited time. Limit of one (1) Clover POS System, or credit card terminal or mobile card reader for the advertised price. \r\n\r\nOffer subject to change without notice. Offer only valid for new customers. Must open a merchant account through National Bankcard Inc. Terms & Conditions apply. Offer only valid with minimum processing requirements. Minimum processing requirements are as follows: to qualify for a free placement of a Clover Station Pro or Clover Station merchant must show a combined monthly processing volume of $20,000 per month on 2 consecutive months of past merchant processing statements. To qualify for a free placement of a Clover Mini or Clover Flex merchant must show a combined monthly processing volume of $10,000 per month on 2 consecutive months of past merchant processing statements. To qualify for a free placement of a Clover Go bluetooth reader merchant must show a combined monthly processing volume of $5,000 per month on 2 consecutive months of past merchant processing statements. To qualify for a free placement of a Verifone VX520 or PAX S80 Credit Card Terminal, or a MobilePay bluetooth reader, there is no past monthly minimum processing requirement. Please ask your sales agent for complete program details.",
                    "placeholder": "",
                    "maxlength": "",
                    "rows": "",
                    "new_lines": "wpautop"
                },
                {
                    "key": "field_5f2c60e3b1319",
                    "label": "Values",
                    "name": "values",
                    "type": "wysiwyg",
                    "instructions": "Please input an unordered list of short descriptive values.",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "tabs": "all",
                    "toolbar": "basic",
                    "media_upload": 0,
                    "delay": 0
                },
                {
                    "key": "field_5f72581947ad3",
                    "label": "Global CTA Section",
                    "name": "global_cta_section",
                    "type": "post_object",
                    "instructions": "Select the reusable block you would like to use as the Global Call To Action Section (used site-wide).",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "post_type": [
                        "wp_block"
                    ],
                    "taxonomy": "",
                    "allow_null": 0,
                    "multiple": 0,
                    "return_format": "id",
                    "ui": 1
                },
                {
                    "key": "field_5f69f7c8781ec",
                    "label": "Woocommerce Shop Page Copy",
                    "name": "woocommerce_shop_page_copy",
                    "type": "wysiwyg",
                    "instructions": "Input the copy text you would like displayed on the Woocommerce Shop Page.",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "<p>National Bankcard carries all of the latest technology in credit card equipment and payment processing software. To receive assistance in finding a solution that is right for your business, call us today at <a href=\"tel:+1-877-977-0598\">1-877-977-0598<\/a>.<\/p>",
                    "tabs": "all",
                    "toolbar": "full",
                    "media_upload": 0,
                    "delay": 0
                },
                {
                    "key": "field_5f3598a3d8534",
                    "label": "TrustPilot API",
                    "name": "",
                    "type": "tab",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "placement": "top",
                    "endpoint": 0
                },
                {
                    "key": "field_5f3598c0d8535",
                    "label": "API Key",
                    "name": "trustpilot_api_key",
                    "type": "password",
                    "instructions": "Input your TrustPilot API Key.",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "placeholder": "",
                    "prepend": "",
                    "append": ""
                },
                {
                    "key": "field_5f368ca083bed",
                    "label": "Business Unit ID",
                    "name": "trustpilot_business_unit_id",
                    "type": "text",
                    "instructions": "Input your TrustPilot Business ID.",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "maxlength": ""
                },
                {
                    "key": "field_5f3a80db576a6",
                    "label": "TrustScore",
                    "name": "trustscore",
                    "type": "text",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "maxlength": ""
                },
                {
                    "key": "field_5f3a8263576a7",
                    "label": "Number of Reviews",
                    "name": "number_of_reviews",
                    "type": "text",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "maxlength": ""
                },
                {
                    "key": "field_5f3a827f576a8",
                    "label": "Stars",
                    "name": "stars",
                    "type": "text",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "maxlength": ""
                },
                {
                    "key": "field_5f43e17d3facc",
                    "label": "Calculator",
                    "name": "",
                    "type": "tab",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "placement": "top",
                    "endpoint": 0
                },
                {
                    "key": "field_5f43e47c3fad3",
                    "label": "Avg % of Transactions by Type",
                    "name": "",
                    "type": "accordion",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "open": 1,
                    "multi_expand": 0,
                    "endpoint": 0
                },
                {
                    "key": "field_5f43e1c73facd",
                    "label": "Avg. % of Transactions: Cash",
                    "name": "avg_percentage_of_transactions_cash",
                    "type": "number",
                    "instructions": "Avg. % of Transactions: Cash",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e2be3face",
                    "label": "Avg. % of Transactions: Debit Card",
                    "name": "avg_percentage_of_transactions_debit_card",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e2e43facf",
                    "label": "Avg. % of Transactions: Credit Card (Non Amex)",
                    "name": "avg_percentage_of_transactions_credit_card_non_amex",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e31e3fad0",
                    "label": "Avg. % of Transactions: Amex Card",
                    "name": "avg_percentage_of_transactions_amex_card",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e33e3fad1",
                    "label": "Avg. % of Transactions: Other",
                    "name": "avg_percentage_of_transactions_other",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e3e93fad2",
                    "label": "% of Transactions",
                    "name": "percentage_of_transactions",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "avg_percentage_of_transactions_cash + avg_percentage_of_transactions_debit_card + avg_percentage_of_transactions_credit_card_non_amex + avg_percentage_of_transactions_amex_card + avg_percentage_of_transactions_other",
                    "readonly": 1,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": 100,
                    "step": ""
                },
                {
                    "key": "field_5f43e4d93fad4",
                    "label": "NBK Discount Rates & Fees",
                    "name": "",
                    "type": "accordion",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "open": 0,
                    "multi_expand": 0,
                    "endpoint": 0
                },
                {
                    "key": "field_5f43e4fa3fad5",
                    "label": "Discount Rate: Cash",
                    "name": "discount_rate_cash",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e5133fad6",
                    "label": "Discount Rate: Debit Card",
                    "name": "discount_rate_debit_card",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e5293fad7",
                    "label": "Discount Rate: Credit Card (Non Amex)",
                    "name": "discount_rate_credit_card_non_amex",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e5443fad8",
                    "label": "Discount Rate: Amex Card",
                    "name": "discount_rate_amex_card",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e55e3fad9",
                    "label": "Discount Rate: Other",
                    "name": "discount_rate_other",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e57e3fada",
                    "label": "Transaction Fee",
                    "name": "transaction_fee",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e5a63fadb",
                    "label": "Monthly Service Fee",
                    "name": "monthly_service_fee",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e5d03fadc",
                    "label": "Competition Discount Rates & Fees",
                    "name": "",
                    "type": "accordion",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "open": 0,
                    "multi_expand": 0,
                    "endpoint": 0
                },
                {
                    "key": "field_5f43e5dc3fadd",
                    "label": "Competition Discount Rate: Cash",
                    "name": "competition_discount_rate_cash",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e5f73fade",
                    "label": "Competition Discount Rate: Debit Card",
                    "name": "competition_discount_rate_debit_card",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e61d3fadf",
                    "label": "Competition Discount Rate: Credit Card (Non Amex)",
                    "name": "competition_discount_rate_credit_card_non_amex",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e6373fae0",
                    "label": "Competition Discount Rate: Amex Card",
                    "name": "competition_discount_rate_amex_card",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e64a3fae1",
                    "label": "Competition Discount Rate: Other",
                    "name": "competition_discount_rate_other",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e65c3fae2",
                    "label": "Competition Transaction Fee",
                    "name": "competition_transaction_fee",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                },
                {
                    "key": "field_5f43e66c3fae3",
                    "label": "Competition Monthly Service Fee",
                    "name": "competition_monthly_service_fee",
                    "type": "number",
                    "instructions": "",
                    "required": 0,
                    "conditional_logic": 0,
                    "wrapper": {
                        "width": "",
                        "class": "",
                        "id": ""
                    },
                    "formula": "",
                    "readonly": 0,
                    "default_value": "",
                    "placeholder": "",
                    "prepend": "",
                    "append": "",
                    "min": "",
                    "max": "",
                    "step": ""
                }
            ],
            "location": [
                [
                    {
                        "param": "options_page",
                        "operator": "==",
                        "value": "theme-general-settings"
                    }
                ]
            ],
            "menu_order": 0,
            "position": "normal",
            "style": "default",
            "label_placement": "top",
            "instruction_placement": "label",
            "hide_on_screen": "",
            "active": true,
            "description": ""
        }
    ]

    Any help is appreciated!

    Hi, I got the problem as well, so I checked the error…

    The problem comes from line 247 in src/Fields.php :
    if (strpos($fieldMeta['formula'], $name) !== false)

    I did a little bit of digging, it turns out some fields do not have a name (tabs for example) and return an empty string.

    A simple check on the length of the name solves it :
    if(strlen($name) && strpos($fieldMeta['formula'], $name) !== false)

    Would be great if it was included in an update 🙂

    Plugin Author wundermatics

    (@wundermatics)

    Hey @unraad

    Thanks for digging that up. We are preparing a new release within the next couple of days and we will include a fix for this issue.

    Plugin Author wundermatics

    (@wundermatics)

    Hey,

    Just wanted to let everybody in this thread know that todays release of version 1.3.0 should fix this issue. If not, please feel free to submit a ticket on our site:

    https://www.wundermatics.com/support/contact/

    Big thanks to @unraad for helping out with pinpointing the issue.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Error message: Empty needle’ is closed to new replies.