Local Food Cooperative Software


The Jist: This software operates on an order cycle instead of an “always open” system. Producers/farmers can log in and add products to their product catalog at anytime for sale. During a designated time, cooperative members place orders.
HomeWho’s Using It?DownloadsHow to HelpOther Resources

Upgrading from version 1.5.2 to version 1.5.3

IMPORTANT: This procedure has only been tested against a clean installation of v1.5.2. It is strongly recommend this process be undertaken on a test server with mirrored data rather than on a live production system and it is likely there will be points of difference in just about every system attempting to upgrade. Absolutely no guarantee is given. Please share your experience to help improve this document.

Updating the code – Using a patch file

NOTE: You will need to have shell-access for this procedure.

  1. Plan your work

    For major changes such as upgrades, it is a good idea to schedule a block of time when member usage will be at a minimum and when there will be no need to run critical functions for a while. That way, if something goes terribly wrong, you will have time to return your system to a stable configuration.

    Read through the entire upgrade process before beginning and be certain you know how to get back to your original setup – either by restoring a backup or by undoing the upgrade process itself. If you are not certain, find someone more experienced to help.

  2. Backup your web files

    The procedure you are about to perform will automatically modify many of your files and if it "goes bad" it can leave you with a mess. Be sure you have a working backup of your website and database contents. Many web hosting companies provide this service.

  3. Download the patch

    Download the v1.5.2 to v1.5.3 patch and save it to your web server.

  4. Prepare to apply the patch

    Open a shell account to your web server and change to the directory immediately above DOCUMENT_ROOT. IMPORTANT: The patch assumes default configuration with a DOCUMENT_ROOT called public_html and all local food coop files in public_html/shop/. If that is not true for your setup, you must move the files – or copies of the files – into that configuration prior to running the patch.

  5. Apply the patch

    Execute the following command to apply the patch to your system:

    patch -Np1 < patchfile

    where patchfile is the path/name to the patch file you saved in step 1.

  6. What to expect

    Running the patch command will output a list of files as they are patched. Ideally, most of them will be silently patched with a message like

    patching file public_html/shop/producers/template.php

    but occasionally – particularly with the .htaccess files – it will complain, which is normal. If you are asked for some kind of confirmation about whether/how to patch individual files, it is probably a sign that the patch is going poorly and should be aborted. There are too many possibilities to discuss in detail here.

Database Modifications

There are no changes to the database in moving from v1.5.2 to v1.5.3. Database changes will be reserved for the next major upgrade to 1.6.x.

Manual File Modifications

As soon as the func/gen_invoice.php function is changed to the updated version in this release, all customer invoices will reflect the changes (including bug-fixes). Consequently, any prior invoice that is regenerated will very likely have new and different totals than before, leaving customers with unexpected debits and credits.

If you can enforce that no prior invoices prior to the update will be adjusted or unfinalized after the update, you will not have any troubles. Otherwise if you need to provide the legacy format, the following modifications are one possible solution that can be put into place to allow for keeping the legacy format for the cycles to which it was initially used. This is not recommended, because it will make future updates more difficult, but is provided here as a possibly necessary step:

Finally, modify the customer_invoice_template.php and tax_functions.php files in the local_food_include directory to suit your preferences. Also check the config_foodcoop.php file to set the new values that were introduced with this release. Set the values for $htmldoc_paging, $random_calc, $membership_taxed, and $coop_fee_taxed.