Jump to content

TypeError: Argument 1 passed to WHMCS\Product\Promotion::appliesToService()


Recommended Posts

TypeError: Argument 1 passed to WHMCS\Product\Promotion::appliesToService() must be of the type int, null given, called in vendor/whmcs/whmcs-foundation/lib/Product/Promotion.php on line 0 and defined in vendor/whmcs/whmcs-foundation/lib/Product/Promotion.php:0
Stack trace:
#0 vendor/whmcs/whmcs-foundation/lib/Product/Promotion.php(0): WHMCS\Product\Promotion->appliesToService(NULL)
#1 clientsservices.php(0): WHMCS\Product\Promotion::getApplicableToObject(Object(WHMCS\Service\Service))
#2 {main}

 

how i can solve this?

Link to comment
Share on other sites

4 hours ago, dewdropz said:

how i can solve this?

your best bet is by opening a ticket with Support...

the only people who will know the answer to your question would be a) users who have come across it before and have either solved it themselves or have opened a ticket (and maybe got a solution), or b) WHMCS Support (one would hope).

the chances of anyone finding this thread from a) anytime soon is VERY remote, and the likelihood of someone from Support wandering in here would be slim too - so quickest way will be to open a ticket and perhaps update the thread if/when they give you a working answer.

Link to comment
Share on other sites

  • 9 months later...
  • 4 months later...

We faced the same issue lately, got a prompt and helpful response from the WHMCS support. I will include the original message sent by them here and hope it helps anyone ended up here in the future:

---

This error indicates null or missing entries in the Pricing or Promotion fields, which can be caused by orphaned products/services.

Please run this query against your WHMCS MySQL database to confirm this cause:

SELECT * FROM tblhosting WHERE packageid NOT IN (SELECT id FROM tblproducts);

If there are any results, the orphaned services can be assigned to a product with this command:

UPDATE tblhosting SET packageid='x' WHERE packageid NOT IN (SELECT id FROM tblproducts)

Replace x with the desired new product ID.

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