Jump to content
  • 0

Something went wrong and we couldn't process your request.


Ashiq

Question

Hi there,
I need urgent help, Please anybody helps me. I explained my issue below:

I tried to include the following script in the /module/hooks.php file.
 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{

$service = Menu::context('service');    
$domain = $service->domain;

if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to cPanel')
                           ->setUri('http://'.$domain.'/cpanel');
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to Webmail')
                           ->setUri('http://'.$domain.'/webmail');
   }
});

After that, I got hooks to file a corruption error. After that, I removed the  <?php ?> starting & end tag because I noticed already have the PHP starting & end tag in this file. After that, I got the error that I attached as a screnshot, please check.  After that, I removed the scrips that I included. But also, The error showing still.

accessing issue.png

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
9 hours ago, Ashiq said:

Hi there,
I need urgent help, Please anybody helps me. I explained my issue below:

I tried to include the following script in the /module/hooks.php file.
 


<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{

$service = Menu::context('service');    
$domain = $service->domain;

if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to cPanel')
                           ->setUri('http://'.$domain.'/cpanel');
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to Webmail')
                           ->setUri('http://'.$domain.'/webmail');
   }
});

After that, I got hooks to file a corruption error. After that, I removed the  <?php ?> starting & end tag because I noticed already have the PHP starting & end tag in this file. After that, I got the error that I attached as a screnshot, please check.  After that, I removed the scrips that I included. But also, The error showing still.

accessing issue.png

Can you switch on Display Errors and post the error you receive? I'm not able to test the code you've posted at the moment.

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
Answer this question...

×   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