Bottelet / DaybydayCRM

DaybydayCRM an open-source CRM, to help you keep track of your daily workflow.
https://daybydaycrm.com
2.24k stars 752 forks source link

Posible problems with relative routes #177

Open Edgarborras94 opened 4 years ago

Edgarborras94 commented 4 years ago

I found some relative routes that might cause errors in certain environments.

ie: resources/views/tasks/show.blade.php:line 269

...
$('#add-invoice-line-modal .modal-content').load('/add-invoice-lines/{{$tasks->external_id}}' + '/task');
...

Can cause errors in example on localhost routes: expected: http://localhost/daybydaycrm/public/add-invoice-lines/id/task what you actually get: http://localhost/add-invoice-lines/id/task

An easy solution might be using laravel URL helper:

...
$('#add-invoice-line-modal .modal-content').load('{{url('/add-invoice-lines/'.$tasks->external_id)}}' + '/task');
...

I'm trying to collect all of this routes to fix them

Should I make a PR after fixing them or is it too specific?

Bottelet commented 4 years ago

No please do, always looking for improvements, a better solution might be too use named routed `{{route('name')}} what's your thought?

Edgarborras94 commented 4 years ago

Sure!! I will collect all the relative url and then look for all the named routes 😉

RikvanderVaart commented 3 years ago

This issue still giving some problems. Especially with the calls in the ajax code. I added {{asset()}} and managed to solve most breaking links. However still some. Also the datatable for the leads is not populating. I am not to versed in jquery and ajax so left this one alone for now. Updated, fixed the datatable after I found the vue component. I added asset() after the get statement on line 88. worked as a charm.