Jump to content

[FIXED] $customfields in Module Development


Recommended Posts

Hi,

 

We have just finished writing a custom server module and noticed the following bug.

 

Let me show you how we can reproduce it!

 

We have 2 products that both have a custom field called "Months Valid For", this is a dropdown field with the values "unlimited,1,2,3,4,5,6".

 

Looking in the database we can see that the id for one of the custom fields is 4 and the other is 5. So far so good.

 

We place an order for one of the products and manually set the "Months Valid For" to 6 everyting is stored and working fine. We then change the Package to the other product and set the "Months Valid For" to 3.

 

At this point we can look in the database and see that the fields are all stored correctly with the right fieldid and relid.

 

BUT - if we click the "Change Package" button which calls our custom server module we get the wrong value given to us. We are referencing the field as $customfields["Months Valid For"]

 

To prove this I inserterd the following PHP code just before the return command:

 

print_r($customfields);

 

You can see from the attached screenshot that even though the "Months Valid For" is set to 5 the module that ran told us it was 4.

 

This is on WHMCS Version: 3.8.2

 

If you need any more information please let me know.

 

Regards

Mark Donne

HOST100

whmcs_example.jpg

Edited by Mark Donne
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated