When changing the title of your admin dashboard tab, it adds more files #137

Closed
opened 2017-10-11 14:31:39 +00:00 by kevincam3 · 7 comments
kevincam3 commented 2017-10-11 14:31:39 +00:00 (Migrated from github.com)

I noticed that when I changed the name of my admin dashboard it creates a new template file but leaves the old one behind.

I noticed that when I changed the name of my admin dashboard it creates a new template file but leaves the old one behind.

Change the name of your admin dashboard... do you mean that you rename you component? Please explain more, not sure I understand the issue.

Side note. If you add or remove admin views then the house cleaning is up to you. Naturally if a file is not used best remove it, yet JCB does not do that for you. So if you change a admin view name it will create a new table and rename all files to this new name, but it will not remove the old files unless you uninstall and reinstall. Or if you in custom install/update script add your own script to check that the file is there and then remove it.

Change the name of your admin dashboard... do you mean that you rename you component? Please explain more, not sure I understand the issue. > Side note. If you add or remove admin views then the house cleaning is up to you. Naturally if a file is not used best remove it, yet JCB does not do that for you. So if you change a admin view name it will create a new table and rename all files to this new name, but it will not remove the old files unless you uninstall and reinstall. Or if you in custom install/update script add your own script to check that the file is there and then remove it.
kevincam3 commented 2017-10-12 01:31:05 +00:00 (Migrated from github.com)

So the two files in the attached screenshot were generated from adding a tab to my admin dashboard following this procedure that I documented: https://jcb34.wordpress.com/add-a-tab-to-your-components-dashboard/

default_kevin_kevin_c.php was created based on the name I gave originally, then I changed the name of the tab and it generated the second file, but the first one is still there and not being used so I have to delete it manually.

I hope that helps you understand what I'm talking about.

image

So the two files in the attached screenshot were generated from adding a tab to my admin dashboard following this procedure that I documented: https://jcb34.wordpress.com/add-a-tab-to-your-components-dashboard/ default_kevin_kevin_c.php was created based on the name I gave originally, then I changed the name of the tab and it generated the second file, but the first one is still there and not being used so I have to delete it manually. I hope that helps you understand what I'm talking about. ![image](https://user-images.githubusercontent.com/870934/31474818-8eebc0e0-aed3-11e7-9b9c-9801647ed6a6.png)

Okay, ya those files are also not removed... the tab names are used to build the file name, so yes if you rename the tab it will great a new file.

Okay, ya those files are also not removed... the tab names are used to build the file name, so yes if you rename the tab it will great a new file.
kevincam3 commented 2017-10-12 09:16:15 +00:00 (Migrated from github.com)

Ok,

So for now we just have to make sure to go in and delete the old unused file(s)? I just think it would be nice not to have that clean up responsibility and have the code either rename the original file or delete the old one in the process of creating the new file.

Ok, So for now we just have to make sure to go in and delete the old unused file(s)? I just think it would be nice not to have that clean up responsibility and have the code either rename the original file or delete the old one in the process of creating the new file.

Hey, you go-head and write the code to do that and I will add it 👍

I feel that dealing with this in a global way is madness.. just to allow each developer to write their own custom install/update scripts to deal with these kind of things is what you would normally have done.

The more automation JCB has the more constraints. You should be happy that it does not just go and delete stuff without your knowledge.

During the last Google summer of code project, we had this very debate, huge debate really. Should we allow users to via the Joomla back-end clean out the database, or should we leave it as it is that only developers will do that with their own custom scripting. The vote siding with not allowing users to access the database directly via the Joomla back-end but to leave it with the developers. Sad as that may be... they had a point, users do not always know how things work, but developers at least should know.

So you should know how to write your own custom script to cleanup, when you make changes to your component. If this is during development... hey why care... it will not be shipped. I mean JCB stops building that old file and it is no longer in the zip package.

Hey, you go-head and write the code to do that and I will add it :+1: I feel that dealing with this in a global way is madness.. just to allow each developer to write their own custom install/update scripts to deal with these kind of things is what you would normally have done. The more automation JCB has the more constraints. You should be happy that it does not just go and delete stuff without your knowledge. During the last Google summer of code project, we had this very debate, huge debate really. Should we allow users to via the Joomla back-end clean out the database, or should we leave it as it is that only developers will do that with their own custom scripting. The vote siding with not allowing users to access the database directly via the Joomla back-end but to leave it with the developers. Sad as that may be... they had a point, users do not always know how things work, but developers at least should know. So you should know how to write your own custom script to cleanup, when you make changes to your component. If this is during development... hey why care... it will not be shipped. I mean JCB stops building that old file and it is no longer in the zip package.
kevincam3 commented 2017-10-12 09:34:48 +00:00 (Migrated from github.com)

Ok, so the last sentence is what I didn't know, so in that case it's fine to leave it. I thought it would ship in the final zip file and that was my concern. I thought I would be shipping my component with a bunch of unused code.

Ok, so the last sentence is what I didn't know, so in that case it's fine to leave it. I thought it would ship in the final zip file and that was my concern. I thought I would be shipping my component with a bunch of unused code.

Great 👍 , well there you have it.

Just open the zip package and check, good practice don't trust JCB to much... always check your packages and make sure all is there, and in the way you expect it to be.

Great :+1: , well there you have it. Just open the zip package and check, **good practice** don't trust JCB _to much_... always check your packages and make sure all is there, and in the way you expect it to be.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#137
No description provided.