Upgrade Tips - Mura Docs v7.1

Upgrade Tips

This section includes some tips for URLs, display objects, and legacy forms when upgrading to Mura v7.1.

Tips for URLs

When installing Mura, you have the option to include or exclude the "SiteID" and the "index.cfm" to/from the URL. If you chose to include both of these in your URL in a legacy version of Mura, the URLs would be generated as follows:

https://domain/{SiteID}/index.cfm/{filename}/

This meant that if you wished to exclude the "index.cfm" file from the URL, you may have to have multiple rewrite rules for each Site you had under your installation. In v7.1, this has changed. The full URLs generated would now appear as follows:

https://domain/index.cfm/{SiteID}/{filename}/

This greatly simplifies rewrite rules for those who wish to omit "index.cfm" from their URLs.

Tips for Display Objects (Modules)

Legacy Mura modules and display objects work as they did before. For example, if Mura finds a known "display_objects" directory, it will use it. That said, you may want to consider following the new "module" directory structure instead.

If you choose to rename your "display_objects" directories over to "modules", you will want to check for any hard-coded references to any custom objects you might have. For example, if you have any snippets of code in a CKEditor window, or layout template, you may need to update them:

[m]$.dspInclude('display_objects/custom/yourFile.cfm')[/m]

Or

#$.dspThemeInclude('display_objects/yourFile.cfm')#

The thing to keep in mind is the path to where your file resides in the new directory structure. If you're going to keep your "display_objects" directory in your theme, you may not have to make any changes. However, if you rename it to "modules", then you will definitely need to locate any references and update them.

Find and Replace Helper Method

You could also try a little helper method baked into Mura to do a "find and replace" on any references stored in the "Body" or "Summary" fields as shown in the example below. You could also use this method to update any URLs to assets uploaded via the editor.

function onApplicationLoad(m) {
	arguments.m.getBean('contentUtility').findAndReplace(
		find="$.dspThemeInclude('display_objects/yourFile.cfm')"
		, replace="m.dspThemeInclude('modules/yourFile.cfm')"
		, siteid=arguments.m.event('siteid')
	);
}

Alternatively, you could go through and simply convert all of your old display objects into v7.1 modules. Doing so will enable your end-users the ability to place your display objects onto the page using the "Inline Edit" feature of Mura, which also allows for using a custom configurator.

See the Mura Rendering section to learn more.

Tips for Legacy Forms

There are three primary items to review when migrating any legacy forms outlined below.

Custom JavaScript

If your form includes any custom JavaScript, you will need to wrap it in a Mura.js method. This is because Mura forms are loaded asynchronously, and Mura.js will automatically defer the loading until the form is ready. The example below illustrates exactly what you need to do.

<script>
Mura(function(m) {
  // Put your JavaScript here.
});
</script>

Did You Use CKEditor?

If you used the "Simple Form" method for creating a form, and within the CKEditor window, you are using a method to include an external .CFM file (as shown below), you will need to follow the steps below to make sure your form(s) work properly.

First, make sure your form includes a method="post" attribute:

Then, you will want to include Mura's "Form Protect" feature as shown below:

The highlighted line of code in the image above is:

#m.dspObject_include(thefile='form/dsp_form_protect.cfm')#

Are You Using FuseGuard?

If you use the FuseGuard Web Application Firewall, you will need to add a new "ignoreVariable" to your filters as show below.

<cfset filter.ignoreVariable('form', 'ishuman') />