V4.5.21 - Self-Hosted - Client Portal, Tickets Module and Google Maps API

I have just installed v4.5.21 and really like it, and would like to start using it for my business, after doing some testing. So far I have got most of the things to work,however an scratching my head with the following and after having done son searching for answers, have not found anything relevant. This has lead me to post on this forum, in the hope that someone can assist.

My issues are as follows (in order of importance to me):

  1. Client Portal - when I either click on ‘View in Portal’ the url is displayed as https://mydomain/clients/mydomain/client/dashboard/… if I remove the first part from the url, that works fine. The setting for the APP_URL is correct and the Settings\Client Portal Settings under the Link has nothing in it. The Client Login on the settings\client portal authorisation section is shown as https://mydomain/mydomain/client/login

Have been trying to figure out where these settings are picked up from but not found it yet.

  1. Tickets Module - I cannot see the option for the tickets module on my system. When I do a php artisan module:install invoiceninja/tickets --type=github I get the message back saying module does not exist. Really like this module, and it is great feature any help in installing it much appreciated.

  2. Google Maps - I have generated a google maps API key, and set it in the .env file but I still get the following error

Google Maps Platform rejected your request. This API project is not authorized to use this API.

I have disabled this feature for now but would be nice if it worked.

Apologies for the long thread, but I need to get these sorted, so that I can complete my testing and start using the product. Will be getting the White label license, once I have completed the testing.

Hi,

  1. Are you using a reverse proxy or is there anything special about your setup? What does the app URL look like?

  2. The ticket module requires using the develop branch of the code from GitHub

  3. The error sounds like a problem with the key permissions

Thanks for a quick reply, wasn’t expecting a response today…

  1. I am using a proxy, but other than that nothing special. the APP_URL in the .env file is https://portal.mydomain.co.uk

  2. Do you have the correct command I need to run?

  3. Have checked the key permissions and have access to all apps. Is there a document which goes through the setup?

  1. Sorry, I’m not sure. Does the admin URL look correct? Can you test it without the proxy?

  2. If you checked out the code from GitHub I think you’d run git checkout -b develop

  3. https://docs.invoiceninja.com/configure.html#google-map

  1. Yes the admin url is fine, I can log and do everything. It is just the url for the client portal.Do you know where it picks up the client portal url? Is there a setting for it in the .env?

2 & 3 - thanks will check those out.

The APP_URL value is used to generate the link. If you’re a developer here’s the relevant code, note in the code SITE_URL is the same as APP_URL.

Just an update - I have got the google maps to work.

What I hadn’t done on the google side of things, after generating the API key, was to enable the ‘Maps Embed API’. Once I did this map comes up great.

On the client portal side - I have setup a test vps server in the cloud and installed invoice ninja. The client portal on that is showing correctly, so this must be down to the proxy I have setup internally. Now to find out how/where to make the changes so that the correct portal is shown. It is weird as everything works.

1 Like

Just noticed a couple of this on the client portal link:

When in the Client screen and you hover over the View in Portal option, the correct url is shown at the bottom of the browser window, but that then changes to the incorrect setting. Inspecting the webpage the href value is correct. and the onclick window open is also correct. Not sure though why the link changes.

This is just an observation, not sure it will lead to the resolution.

There is code in the app which changes the link in order to add ?silent=true when you click it to prevent the app from thinking the client has viewed it.

That would make sense. Still doesn’t explain why on the inspect screen the correct url would be shown:

https://portal.mydomain.co.uk/clients/portal.mydomain.co.uk/client/dashboard/zr7olvscqep2wnunhz70torytswp6mrt

The difference I have noticed is that first part has ‘clients’ and the second has client. Where are these added in the code? I have been through the .env file and commented out anything that has the url in it, but does not make any difference.

Here’s the code for the contact’s client portal link

Changing line 205 to:

return “{/client/dashboard/{$this->contact_key}”;

Has worked. I have also changed the same on the test cloud system and that continues to work. So the issue is not really with running via proxy.

This has sorted it on the client screen, but guessing it needs changing on other screens, such as the quote screen? In the settings\client portal it still shows the incorrect setting.

Glad you found a solution! I’m not sure that proves the proxy isn’t the issue though, why otherwise would you see different behavior between the two apps?

The values are shown on Settings > Client Portal are just for display, what matters is that the links in the email are correct and they work.

Note: one possible problem with your change is that the links may not be correct if generated by the cron, ie. when creating recurring invoices

I am also worried about what other functions are setup the same as this one, and potentially may need changing. By the looks of things the $url is derived from the SITE_URL, which I am assuming is the APP_URL in the .env file? The APP_URL is correct. The contact form line that I changed, removed one part of the URL. So where did the rest get added on??

Sorry, I’m not sure…