Jump to content

Error: Call to a member function getRawAttribute() on null

Recommended Posts

  • WHMCS Support Manager

Hi there,

This error indicates the client account contains an orphaned service. Ie. A service without a valid product assigned to it:

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


One potential approach to resolve this might be:

  1. Create a new hidden product (Configuration > System Settings > Products/Services)
  2. Call it something like "Orphaned Product"
  3. Save the product and take a note of the ID (tblproducts.id)
  4. Then run this SQL query against your database:
UPDATE tblhosting SET packageid='x' WHERE packageid NOT IN (SELECT id FROM tblproducts);

Replace x with the ID of the newly created product.

As always, before making changes to your database, please backup.

Link to comment
Share on other sites

  • 4 weeks later...
  • WHMCS Support Manager

Hi @Faizal1,

Glad to hear that helped!

If you do not require the orphaned records, they can be safely deleted via the admin UI. Navigate to the client's Products/Services tab and click More > Delete.

Relevant documentation: https://docs.whmcs.com/Clients:Products/Services_Tab#Delete


Link to comment
Share on other sites

  • 1 year later...

same problem here, 

client account not contains an orphaned service, every service have valid product assigned

the only way i find it to go around was:


$disable_hook_loading = true;

into configuration.php file

until here work if twenty-one or my duplicate of twenty-one is set on System Theme

but when set Lagom 2 as a theme  error came back

Error: Call to a member function cssInjector() on null in /home/aaa/templates_c/cc9ea936d52fb3c54d0f68350338a8988d8ef771_0.file.head.tpl.php:88

line 88: <?php echo $_smarty_tpl->tpl_vars['RSThemes']->value['styles']['colors']->cssInjector(!$_smarty_tpl->tpl_vars['adminLoggedIn']->value);?>

with this:

$disable_hook_loading = true;

if i set like

$disable_hook_loading = false;

or comment

//$disable_hook_loading = true;

got this one

Error: Call to a member function isYearly() on null in /home/aaa/templates_c/6f90dc7889284c0fbbe03dbfe37684132f6f1c87_0.file.upsell.tpl.php:86

line: <?php if ($_smarty_tpl->tpl_vars['product']->value->pricing()->first()->isYearly()) {?>


anyone have this kind of issues or find a solution for?

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.

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