Support

Account

Home Forums Bug Reports Automatic removal of leading 0 in fieldname

Solved

Automatic removal of leading 0 in fieldname

  • Hi @Elliot

    I’ve got a site which has a page for translationstrings.. The fields are set up like 001, 002, 003 etc. and then I have a function which I use to retrieve the proper translation (with WPML).

    I recently updated all plugin + wp on this site and now all my fields have lost all leading 0 in the fieldname, so instead of 001, 002 its just 1, 2 etc.

    I tried resetting this manually but no dice, on save they all went back to 1,2,3 etc.

    My question is if it’d be possible to remove this “validation” from the plugin and where I do it? I understand that you probably have a reason to why it’s there but I’d rather remove it and live with the danger since otherwise I’d have to go through all template files and change the fieldname AND retype all translations for 12 languages.

    For me, the best solution would be (if you’re not willing to completely remove this) if you could help me find what to outcomment and if you’d put in a filter or something which I can use to disable the validation in future updates so I don’t have to change the core code with each update 🙂

    Thanks!

    ps. I’ll file this as an bug. I suppose it’s not technically true but in some ways it could be considered a bug since it messes with the users input

  • Hi @Jonathan

    Great bug find! Yes, I have just tested and fixed this issue.

    The solution was to add a $restriced array in the parse_types function which will now avoid parsing values for ‘name’, ‘label’, etc…

    You can find this in the latest git version

    Cheers
    E

  • Awesome @elliot!

    Thanks alot, my client will be very happy to avoid the extra work 😉

  • Cheers mate.

    Thanks again for the bug report

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Automatic removal of leading 0 in fieldname’ is closed to new replies.