FIX: keep external module element when adding resource

When adding object from external module as a resource we need to keep @modulename as defined into url rather than use `element` property (which do not contain @modulename).
This commit is contained in:
Librethic 2018-10-27 11:46:12 +02:00 committed by GitHub
parent d800fe9256
commit fcd687642c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr>
/* Copyright (C) 2013-2018 Jean-François Ferry <hello+jf@librethic.io>
* Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
@ -94,7 +94,7 @@ if ($action == 'add_element_resource' && ! $cancel)
else
{
$objstat = fetchObjectByElement($element_id, $element);
$objstat->element = $element; // For externals module, we need to keep @xx
$res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory);
}
if (! $error && $res > 0)