Anonymous Login
2023-01-27 15:21 PST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000329v1.2 Release (Closed)[All Projects] Generalpublic2010-01-06 19:52
Assigned Tocaseydk 
Product Version1.2 
Target VersionFixed in Version1.2.1 
Summary0000329: Trying to add a new department is not possible. Department Company field not populated.
DescriptionWhenever I try to add a new department I get the error message:

This company is invalid. You cannot add a department.

Reason being I can't assign the department to any company and Department Company name doesn't show up at all.
TagsNo tags attached.
Attached Files




blienard (reporter)

You can correct this by patching the modules/departments/departments.class.php
line 134 replace
if ($this->dept_id == $this->dept_parent)
if ($this->dept_id && $this->dept_id == $this->dept_parent)
has in previous releases.


Fran (reporter)

Hi blienard!

Thanks for your support!

Just tried your solution, but does not work (for me at least). Changing this line 134 in department.class.php has not changed this issue. It keeps showing nothing in Department Company field.

Happens to me even if I download the 1.0, 1.1 or 1.2 release version no matter if I test it locally or in my remote hosted app. In all versions I'm not being able to create Departments


blienard (reporter)

Last edited: 2009-12-11 00:34

Hi Fran !

This is true, Company name is not filled out when you click on "new department" but submit works in my case after this fix.

However if you want company name in the form, even if it is not the best fix, you can add following code in departments/addedit.php

after line 39 : $company_id = $dept_id ? $department->dept_company : $company_id;

add code

        if($company_id && $department->company_name=='')
                $company = new CCompany();
                $department->company_name = $company->company_name;


Fran (reporter)

What you are pointing is also true in my case...Company Department name still doesn't appear but if I enter the name of a new Department, now the application is not giving back the error message any more.

Also tried your piece of code in addedit.php, but at first sight I couldn't figure out what has changed. The issue with the Company Department name still there but at least we can now input new Departments through the GUI.

I wish I could help you more but my php knowledge is so limited, but my ears are wide open to try to get what you are doing. I'll check the effect of the modification in addedit later today.

Thanks in advance.


caseydk (administrator)

If you look at revision 848, I've made the changes that are necessary and added more validation in general.


Fran (reporter)

Thanks to caseydk...

As in the solution provided by blienard I can enter new departments now...but Company Name doesn't appear anyway.

Thanks again


caseydk (administrator)

This is resolved in trunk as of r871. This fix - along with a number of others - are likely to be rolled into a 1.2.1 release.


caseydk (administrator)

Merged the relevant changes from r848 and r871 in r883 into the version1.2.x branch in svn. A new release should come early next week.


caseydk (administrator)

In v1.2.1 release.

-Issue History
Date Modified Username Field Change
2009-12-10 21:01 Fran New Issue
2009-12-10 23:34 blienard Note Added: 0000640
2009-12-10 23:59 Fran Note Added: 0000641
2009-12-11 00:33 blienard Note Added: 0000642
2009-12-11 00:34 blienard Note Edited: 0000642
2009-12-11 01:27 Fran Note Added: 0000643
2009-12-11 20:40 caseydk Status new => resolved
2009-12-11 20:40 caseydk Resolution open => fixed
2009-12-11 20:40 caseydk Assigned To => caseydk
2009-12-11 20:40 caseydk Note Added: 0000644
2009-12-12 18:05 Fran Status resolved => feedback
2009-12-12 18:05 Fran Resolution fixed => reopened
2009-12-12 18:05 Fran Note Added: 0000645
2009-12-19 22:10 caseydk Status feedback => resolved
2009-12-19 22:10 caseydk Resolution reopened => fixed
2009-12-19 22:10 caseydk Note Added: 0000674
2009-12-24 20:52 caseydk Note Added: 0000685
2010-01-06 19:52 caseydk Note Added: 0000728
2010-01-06 19:52 caseydk Status resolved => closed
2010-01-06 19:52 caseydk Fixed in Version => 1.2.1
+Issue History