Jump to content
timnboys

Input->SetError no longer works on addservice() method

Recommended Posts

8 hours ago, timnboys said:

Hello could anyone including @Paul @Tyson @Cody @Jono help me with stopping the addservice() function in a module on error.


$this->Input->setErrors(array('api' => array('internal' => "ErrorMessage", true)));
return;

^ that seems to no longer stop the service from being added as it should.

the same code was working before ?

Share this post


Link to post
Share on other sites
8 minutes ago, Blesta Addons said:

the same code was working before ?

I don't know to be honest, after checking the functionality of the module everything was screwed up because it returned to modules/installed after trying to delete a module row, so maybe it was related to that, who knows.

Share this post


Link to post
Share on other sites
1 minute ago, timnboys said:

I don't know to be honest, after checking the functionality of the module everything was screwed up because it returned to modules/installed after trying to delete a module row, so maybe it was related to that, who knows.

try

 

            $this->Input->setErrors(
                ['module_row' => ['error' => "error here"]]
            );
            return;

 

Share this post


Link to post
Share on other sites
40 minutes ago, Tyson said:

I don't encounter this issue myself. YourModule::addService can set errors to the Input component in order to prevent service creation. I'd need more context to determine the issue you're experiencing.

I fixed that somewhat already now I am running into another issue on the backend api, it seems this is erroring on trying to create a invoice from the service:

Undefined index: inv_type                on line <strong>2853</strong>
                in <strong>/var/www/html/app/models/invoices.php</strong>

Share this post


Link to post
Share on other sites

It sounds like your company does not have all of its settings defined for some reason. You may want to update the company settings under Settings > Billing/Payment > Invoice Customization and re-save the settings. The one you're missing based on that error is the "Invoice Type".

Share this post


Link to post
Share on other sites
1 hour ago, Tyson said:

It sounds like your company does not have all of its settings defined for some reason. You may want to update the company settings under Settings > Billing/Payment > Invoice Customization and re-save the settings. The one you're missing based on that error is the "Invoice Type".

well I found that setting company_settings not $client_settings as app/models/invoices.php is referring to hence the error.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×