Leading Zero in URL Query Causes Error

Created on 17 January 2023, almost 2 years ago
Updated 20 March 2023, almost 2 years ago

Problem/Motivation

Trying to prepopulate a mobile number but the leading zero causes the wrong number to be populated

Steps to reproduce

Create a text field and set EPP value to [current-page:query:tel]
Add new content with query like /node/add/mycontent?tel=098765432
This causes the error but if you remove the leading 0 then no issue

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia davidkp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany geek-merlin Freiburg, Germany

    Thanks for reporting this. From the IS is not clear though what happens, what the undesired outcome is.

    Thought: Try quotes around the token.

  • 🇮🇳India mehul.gada Mumbai

    The given module is using YAML parser to parse the token. Till Symfony 5.0 version, YAML 1.1 specifications were used which was converting strings starting with 0 to octal numbers and strings starting with 0x to hexadecimal numbers. From Symfony 5.1 onwards, the representation of the octal number changed to "0o..." and that will fix the issue mentioned here.

    So, we have 2 options here:

    1. Upgrade to Drupal 10 as it uses a higher version of Symfony (not possible for all web projects and needs more efforts)
    2. While using a token in field config, enclose it in quotes as mentioned in comment #3 🐛 Leading Zero in URL Query Causes Error Active to fix the issue.
Production build 0.71.5 2024