Ramblin Ramblin

How do I edit existing view.detail and view.edit files via manifest file scripts?

Discussion created by Ramblin Ramblin on Mar 9, 2014
Latest reply on Jun 2, 2014 by Jason Eggers
I am creating a custom module that will adjust the Accounts module detail view (considerably) and add custom code to how Accounts displays its panels and subpanels.

Thanks to a lot of help from this forum and others, I know how to do all that I want to do via editing the various view definition files, but I need to put considerable code into view.detail.php and view.edit.php.

This is not a problem if the view.edit.php file and view.detail.php files do not already exist in custom/modules/Accounts/views; I know what to do when I am creating a fresh view.edit and view.detail solution.

I am able to put all the code I want into the right place and it works when I can create new view.edit and view.detail files.

However ...

If the view.detail or view.edit files are already in the custom directory, then I am stumped as to how to preserve the previous customizations AND add mine.

I can edit existing detailviewdefs and editviewdefs using the ParserFactory as described at
How can I add panels and fields to existing module layouts via manifest?

but that does not work with the view.edit and view.detail files.

The view.edit and view.detail files have so many possible things that can be put in them, I do not know how to edit an existing one.

Is there a tool to help with this?
Is there a trick someone knows about to allow this to be (relatively easily) done?

If there is no tool or trick, is there a way to test for the presence of the view.edit or view.detail files (this much I know how to do in manifest pre_install or pre_execute script) and then terminate the module installer based on the result of the conditional test?

Outcomes