Please ask before changing form code

markleeds wrote on Wednesday, May 14, 2008:

I have two areas of code that I have worked on that are form related and mostly independent of openemr.  They are formscript.pl and the CAMOS form.  Whenever I fix a bug or add a feature which benefits my own work, I commit it to cvs.  Of course, I run cvs update first just to be safe.

In the past, I have been asked first before any of this code was altered by others.  Rod Roark fixed some queries in CAMOS for backwards compatibility and Mike Brinson contributed comments, formatting and bug fixes to formscript.pl.  By discussing the changes first, these programmers avoided unforseen problems which an author or maintainer of code can help to prevent.  I understand that with much of openemr, the original authors are unavailable for consultation.

Recently, lemonsoftwarero and cfapress on two different occasions made changes to code in these areas which caused merge errors when I performed a cvs update.  I understand that they are making sweeping changes throughout all of the openemr code which will improve the functioning of the program in the future.

Forms are plugins and are different from other modules.  They need to work independently of the current version and often maintain backwards compatibility with older versions.

Please correct me if I am wrong about my feelings on this subject.  I have not been involved in any other collaborative projects of this size before.

cfapress wrote on Thursday, May 15, 2008:

Hi Mark,

I’m looking through the contrib folder and trying to remember what I may have changed in there. I can’t think of anything. Truth be told, I looked at that folder once and slowly backed away. There’s a large number of directories with such a variety of content that I felt any changes I made would need to be made throughout each folder and I just don’t have the time for that.

More likely though, a library used by some of the forms was changed by me. I’m guilty of a few bugs in some of the libraries. Normally when I make a change to a library I’ll do a ‘grep’ throughout all the source to make sure my library change is reflected whereever the function is called.

I agree that the contents of the contrib folder are plugins and not really part of the base code for OpenEMR.

I’ll join you in emphasising the need to perform a ‘cvs update’ before doing a ‘cvs commit …’ of any kind.

Jason

markleeds wrote on Friday, May 16, 2008:

It was actually the cvs update command that broke the code on my end due to some kind of error.  It turned out to be no big deal, easy to fix.

I suspect it is the utf8 compliance and fixing of the ^Ms that may be causing these merging errors with cvs update.

Regarding breaking backwards compatibility, there was a function call added to the CAMOS form (and probably in many other places).  As I mentioned in another post, if function calls to new library functions are placed in forms which are meant to be backwards compatible, they should be done in such a way that if the function doesn’t exist, the code still runs (maybe try/catch blocks).

Jason, actually, I do not think that anything I know of in the contrib directory was affected.  I was mostly giving it as an example, similar to the forms directory, which was affected.  I need to be more careful and not call cvs update on my live code.