When I'm creating an asset that I've established before that has custom fields, it appears an
Server Error: 500 (Internal Server Error).
If I remove the custom fields to the model, and then I create the asset, it has no issue, but I don't want to do all this steps when creating a new asset with every model.
Any clue what could it be?
(what actually happens goes here)
app/storage/logs and your webserver's logs.Please provide us with the information requested at the Getting Help documentation: http://docs.snipeitapp.com/getting-help.html
Snipe-IT Version: (v2.1.0-8)
CentOS release 6.7 with Apache/2.2.15
ErrorException (E_RECOVERABLE_ERROR)
/**
* Associate the model instance to the given parent.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @return \Illuminate\Database\Eloquent\Model
*/
public function associate(Model $model)
{
$this->parent->setAttribute($this->foreignKey, $model->getAttribute($this->otherKey));
Page: http://xx.xx.xx.xx/hardware/create
The error doesnt happen in the demo version
[2016-04-14 19:09:46] production.ERROR: exception 'ErrorException' with message 'Argument 1 passed to Illuminate\Database\Eloquent\Relations\BelongsTo::associate() must be an instance of Illuminate\Database\Eloquent\Model, null given, called in /var/www/html/snipeit/app/controllers/admin/AssetsController.php on line 104 and defined' in /var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php:203
Stack trace:
I havent alter anything on the db on my own.
Hope this is enough ;) please let me know
Please tell me if there are any browser console errors, per the getting help documentation.
Solicitud desde otro origen bloqueada: la pol铆tica de mismo origen impide leer el recurso remoto en http://10.10.60.12//hardware/models/57/custom_fields?_token=geGktyqlnotCNk0cIzHvpSbhCKNxeNBTLWI4OnEK (raz贸n: falta la cabecera CORS 'Access-Control-Allow-Origin').
This is the error that appears when I select the model (that has the custom field) but the custom fields are not shown.
My browser is mozilla and it is on spanish .... do you need to turn back my browser to english?
No, it's complaining about a CORS policy mismatch. This usually happens when your url set in app/config/production/app.php doesn't match your actual URL. Can you tell me what you have for your url in app/config/production/app.php?
(And also tell me what the actual URL in your browser is for the create page)
'url' => 'http://10.10.60.12/' (my private ip)
My URL when creating the asset is
http://XX.XX.XX.XX:8083/hardware/create (it has an public IP address, cause I need to access from the internet)
And ..... XX.XX.XX.XX is different from 10.10.60.12 of course ;)
That's your problem. That URL in your app/config/production/app.php needs to match the URL you're accessing the site from. Fix that, and you should be all set.
(Also, no trailing slash on the URL in app/config/production/app.php)
You're awesome!!!!
Thanks!!! :)
It worked then?
Yes!
It is so beautiful now :)
Excellent, glad you got it sorted.

Most helpful comment
It worked then?