Skip to content

Problem with form fields #412

@pnpaes

Description

@pnpaes

I am using craftcms 5.7.4 and Stripe Lite 6.0.3...
My form fields are not working as intended. Some fields types like numbers and dropdowns, instead of having the label, formHandle, options and required fields, instead they have it with a number concatenated to the name.
the dropdown field has label3, fieldHandle3, options3 and required3. THe number the number field has label5, fieldHandle5 and required5.
Then, since the function can't retrieve the handles and labels (since that only checks the label and fieldHandle) i get handle string as handles in the metadata and also when retrieving the fields in the order to display the receipt and send the custom emails.

I added a hack to the variables/StripeVariable.php file with this:

    public function labelToHandle($block)
    {
        $label = $block->label ?? Stripe::$app->orders->getRandomStr();
        $handleFromUser = $block->fieldHandle ?? $block->fieldHandle3 ?? $block->fieldHandle5 ?? $block->fieldHandle6 ?? $label;

        $handle = Stripe::$app->paymentForms->labelToHandle($handleFromUser);

        return $handle;
    }

Image

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions