Difference between revisions of "Upgrading to JReviews 3"

From JReviews Documentation
Jump to: navigation, search
(Server Requirements)
(Troubleshooting After the Upgrade)
Line 66: Line 66:
  
 
1. Renamed your overrides folder if you have customizations
 
1. Renamed your overrides folder if you have customizations
 +
 
2. Renamed the JReviews Add-ons folder if you have any add-ons installed
 
2. Renamed the JReviews Add-ons folder if you have any add-ons installed
 +
 
3. Completely uninstall both JReviews and S2Framework from the site before installing the new versions
 
3. Completely uninstall both JReviews and S2Framework from the site before installing the new versions
 +
 
4. Do not rename back the overrides or add-ons folders after the upgrades. 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.
 
4. Do not rename back the overrides or add-ons folders after the upgrades. 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.
 +
  
 
=== Some front-end pages don't load ===
 
=== Some front-end pages don't load ===

Revision as of 11:23, 16 March 2018

Upgrading to JReviews 3

Please read the entire upgrade guide in detail and follow every step for a seamless upgrade. If you encounter any issues, it's better to submit a ticket with access so we can help you.

Server Requirements

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

Upgrade Guide

JReviews 3 has a very large number of code changes so it is not possible to upgrade using the remote updates feature. Also, given the number of changes, none of the previous version files, including theme files, are compatible with this version, so you will need to bring all your code overrides up to date.

To upgrade from JReviews 2.x you need to follow these steps without skipping any of them.

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 domain, especially if you have customizations.

2. If you have customizations, disable JReviews overrides to disable them because they will not be compatible with JReviews 3. To do this, rename the following folder to keep a backup of your changes. Do not rename the folder back to its original name after the upgrade:


Joomla

/templates/jreviews_overrides

WordPress:

/jreviews_overrides


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 upgrade. You can find the Add-ons folder at:

Joomla

/components/com_jreviews_addons

WordPress:

/wp-content/plugins/jreviews_addons

4. Uninstall the S2Framework and JReviews from your site. This step is important to remove all the outdated files from the system before installing the new version.

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.

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.

Troubleshooting After the Upgrade

JReviews admin doesn't load, shows blank page or error Class 'ConfigComponent' 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" error shows up, then this means that you have outdated code from JReviews 2 on your installation and you need to re-do the upgrade 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 before installing the new versions

4. Do not rename back the overrides or add-ons folders after the upgrades. 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.


Some front-end 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.