Difference between revisions of "Upgrading to JReviews 3.6"

From JReviews Documentation
Jump to: navigation, search
(JReviews admin doesn't load, shows blank page or error Class 'XYZ' not found)
(Server Requirements)
Line 16: Line 16:
  
 
* PHP 7.0-7.2
 
* PHP 7.0-7.2
* PHP Extensions: json, mbstring, curl, bcmath, fileinfo
+
* PHP Extensions: json, mbstring, curl, bcmath, fileinfo, exif_read_data
 
* upload_max_filesize in php.ini must be higher than 6M to be able to upload the installation packages
 
* upload_max_filesize in php.ini must be higher than 6M to be able to upload the installation packages
  

Revision as of 11:12, 20 February 2019

Updating to JReviews 3.5

This guide is valid for updating from JReviews 2.7 and 3.0 to all JReviews 3.5 versions. The most notable changes in JReviews 3.5 are the following:

  • All files have been updated to reflect the new open source license
  • The "Everywhere Add-on" has been removed from the core and is now a separate Add-on that can be installed from the JReviews App Store.
  • The "Add-on Manager" has been extracted from the core and is now a separate, free, Add-on that can be installed from the JReviews App Store.

If you are on JReviews 3.1, this is a very straightforward update, because you can continue using your previous JReviews 3.1 customizations.

Please read the entire update guide in detail and follow every step for a seamless update. If you encounter any issues, submit a support ticket with site access so we can help you.

Server Requirements

  • PHP 7.0-7.2
  • PHP Extensions: json, mbstring, curl, bcmath, fileinfo, exif_read_data
  • upload_max_filesize in php.ini must be higher than 6M to be able to upload the installation packages

Step By Step update Guide

If you are updating from JReviews 2.7, keep in mind that JReviews 3.x has a very large number of code changes. This means that none of the previous version files, including theme files, are compatible with this version. You need to bring all your code overrides up to date after finishing the update. You may also want to read What happens with modified files when JReviews is updated.

As always, be prepared for the worst when performing an update:

1. Make a backup of your site and be prepared to use it if something goes wrong. Consider first testing the update in localhost or a development site.

2. If you have customizations, disable JReviews overrides before you begin. To do this, rename the following folder to keep a backup of your changes.

Joomla

/templates/jreviews_overrides

WordPress:

/jreviews_overrides

After you finish the update, if you were previously on JReviews 3.1 you can rename the folder back to "jreviews_overrides" and continue to use your customizations. If you are updating from JReviews 2.7, you can create a new "jreviews_overrides" folder and start migrating your customizations using the new versions of the files in JReviews 3.5.

3. Disable all installed Add-ons by renaming or deleting the entire Add-ons folder. Do not rename the folder back to its original name after the update. You will re-install them in the lat step. You can find the Add-ons folder at:

Joomla

/components/com_jreviews_addons

WordPress:

/wp-content/plugins/jreviews_addons

4. Uninstall S2Framework and JReviews from your site.

This step is important to remove all files from the system before installing the new version. Some files no longer exist, so installing over the existing components without removing them first will allow those files to remain in the system and cause problems. Uninstalling the S2Framework and JReviews will not remove your existing data for listings, reviews, media, etc.

Joomla: Use the Extensions Manager to uninstall the S2Framework Component and the JReviews component. Don’t uninstall the JReviews modules because you will lose all your module settings if you do this.

WordPress: Use the Plugins Manager to uninstall the S2Framework Plugin and the JReviews Plugin.

5. Continue with normal installation steps for JReviews.

Download the JReviews 3.5 package from the Client Area.

Joomla

Use the Extensions Manager to install the S2Framework component first, then the JReviews component.

WordPress

Use the Plugins Manager to install the S2Framework plugin first, then the JReviews plugin.

6. Clear the browser cache to force the browser to load updated versions of CSS and Javascript files.

7. Finally, if you had any Add-ons installed before, you can re-install them again now.

You need to have an active support & updates subscription to be able to install Add-ons. Click on the "JReviews App Store" button in the JReviews admin dashboard and re-install the Add-ons.

Must Read About Caching

This is specifically related to Joomla so if you are using WordPress feel free to ignore. JReviews 3.5 has a new Asset Loader System Plugin which is fed all the CSS and scripts required by component and modules and then sends them all at the same time to the head of the page before the page is rendered.

So what does this have to do with caching?

In Joomla, when you use the Configuration Cache, once a module is cached the code for the module is no longer run so it's not possible to load the necessary CSS and scripts for that module. To fix this you need to speficifically disable caching inside the module settings. So the recommendation, unless you have a very specific reason to use the Configuration Cache, is to leave that disabled, and instead enable the Page Cache System Plugin. This one caches the entire page (component and modules), so all CSS and Scripts are taken into account in the cache.

While on the topic of caching, make sure you have the platform specific caching option enabled in the Joomla configuration to ensure proper caching of pages for both mobile and desktop devices.

Troubleshooting After the update

JReviews admin doesn't load, shows blank page or error Class 'XYZ' not found

If you see a blank page, enable Development error reporting in the Joomla configuration or enable debug mode in WordPress. If the "Class 'ConfigComponent' not found" or "Class 'JReviews\Models\ConfigurationModel' not found" error shows up, then this means that you have outdated code from JReviews 2 on your installation and you need to re-do the update steps above. It's important to make sure that you:

1. Renamed your overrides folder if you have customizations

2. Renamed the JReviews Add-ons folder if you have any add-ons installed

3. Completely uninstall both JReviews and S2Framework from the site. Then install the new versions downloaded from the Client Area.

4. Re-install Add-ons, if any, via the JReviews App Store on your site.

5. Do not rename back the overrides or Add-ons folders after the updates. The renaming is only for backup purposes and you can delete those renamed folders once you have transferred all customizations and everything is working as you expect.

Expired updates message

After updating, if you see a message similar to the one below it means your installation contains outdated files.

To use JReviews v2.7.xx.xx with this license you need to renew your updates. 
This version of JReviews was released after your updates expired.

You just installed JReviews 3.5, so there should be no reference to JReviews 2.7. Go back and re-do step 4. above.

Some front-end and admin moderation pages don't load

If you are using custom code in the PHP Format setting of custom fields, it's possible that some of this code no longer works and needs to be updated with new syntax. For example the $Access class is no longer used in JReviews 3. For now please post in the forum your existing code so I can provide the updated one. You can unpublish the custom field(s) until you get it working again.

If you were using the $Access class to perform checks before in themes or in custom fields, you need to update your code. Here are some of the most common uses and the new requivalent code:

Customization code changes related to user and access settings

Use JReviews 2 JReviews 3 Theme JReviews 3 - Field PHP Format
Check if current user belongs to admin group $Access->isAdmin() $this->auth->admin $User->admin
Check if current user is a guest $Access->isGuest() $this->auth->guest $User->guest
Current user ID $User->id $this->auth->id $User->id

Other important framework changes

Notifications

In JReviews 2 email notifications were handled through /controllers/components/notifications.php. In JReviews 3 they are handled through event listeners. These notification listeners can be found in the /jreviews/events/listeners directory and most of them begin with the "send_" prefix. You can see this is very modular and much easier to read and modify than having a single, huge file, that was responsible for all system notifications. Read the Events documentation article to learn more.

Community Integrations

This mostly applies to Joomla for stream posting to EasySocial and JomSocial. In JReviews 2 these actions were handled through plugins in cms_compat\joomla\plugins\ with one plugin file per component handling all actions. In JReviews 3 they are handled through event listeners that can be found in /jreviews/cms_compat/joomla/events/listeners. Each component has it's own directory with individual listeners for each type of event. Read the Events documentation article to learn more.