This was discussed in this thread : https://sourceforge.net/p/itop/discussion/1113906/thread/29f296be60/?limit=100
So we extendended iTop's datamodel to include a set of default services for all users on the portal. To do so, we redefined the oql view on ServiceFamily, Service and SubService's scopes by adding a union on the existing request.
The result wasn't the one we expected as it crashed the new requests's page on the portal, displaying this error message :
RenameAlias: alias 'L-1-1' already used
It seems the class redefinition causing this issue is this one.
<class id="ServiceFamily" _delta="must_exist">
<scopes _delta="must_exist">
<scope id="all" _delta="must_exist">
<oql_view _delta="redefine"><![CDATA[
SELECT ServiceFamily AS sf
JOIN Service AS s ON s.servicefamily_id = sf.id
JOIN lnkCustomerContractToService AS lnk ON lnk.service_id=s.id
JOIN CustomerContract AS cc ON lnk.customercontract_id=cc.id
WHERE cc.org_id = :current_contact->org_id
UNION SELECT ServiceFamily AS sf
JOIN DefaultService ON DefaultService.servicefamily_id = sf.id
WHERE DefaultService.status != 'obsolete'
]]>
</oql_view>
</scope>
</scopes>
</class>
The code raising this exception seems to be :
core/dbobjectsearch.class.php:207
public function RenameAlias($sOldName, $sNewName)
{
$bFound = false;
if (array_key_exists($sOldName, $this->m_aClasses))
{
$bFound = true;
}
if (array_key_exists($sNewName, $this->m_aClasses))
{
throw new Exception("RenameAlias: alias '$sNewName' already used");
}
...
Callstack
dbobjectsearch.class.php:207, DBObjectSearch->RenameAlias()
dbunionsearch.class.php:236, DBUnionSearch->RenameAlias()
browsebrickcontroller.class.inc.php:125, Combodo\iTop\Portal\Controller\BrowseBrickController->DisplayAction()
HttpKernel.php:151, Symfony\Component\HttpKernel\HttpKernel->handleRaw()
HttpKernel.php:68, Symfony\Component\HttpKernel\HttpKernel->handle()
Application.php:496, Silex\Application->handle()
Application.php:477, Silex\Application->run()
index.php:167, require_once()
index.php:51, require_once()
exec.php:77, {main}()
Are we doing something wrong or is it a bug we have found ?
Hello,
Please use the forums ("discussion" tab) for any assistance request.
Tickets are reserved for qualified bugs reports or enhancement requests.
Thanks.
Diff:
Attached the XML to reproduce.
The Service scope alone can work if replacing DefaultService with Service. Here is the modified query :
SELECT Service AS s JOIN lnkCustomerContractToService AS lnk ON lnk.service_id=s.id JOIN CustomerContract AS cc ON lnk.customercontract_id=cc.id WHERE cc.org_id = :current_contact->org_id AND s.status != 'obsolete' UNION SELECT Service AS ds WHERE ds.status != 'obsolete' AND finalclass='DefaultService'But if adding the ServiceFamily scope the error comes back again.
Attached a delta to reproduce the problem on a standard iTop.
Diff:
Matt tried this workaround that does not work either (error : SetSelectedClasses: Invalid class alias L-1-1)
ServiceFamily scope :
Service scope :
Combodo db ref : N°2585
Fixed in 2.7.2-1