Difference between revisions of "Upgrading to JReviews 3"
(→Some front-end pages don't load) |
|||
Line 72: | Line 72: | ||
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 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: | ||
+ | |||
+ | |||
+ | == Available PHP Classes and Variables == | ||
+ | |||
+ | {| class="wikitable" cellpadding="0" cellspacing="0" | ||
+ | |- | ||
+ | |'''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 | ||
+ | |} | ||
+ | |||
[[Category:JReviews]] | [[Category:JReviews]] | ||
[[Category:Upgrade]] | [[Category:Upgrade]] |
Revision as of 14:38, 10 March 2018
Contents
Upgrading to JReviews 3
JReviews 3 is still in Beta and not deemed suitable for production sites. Please install it on a development site first and report any bugs in the forum. The documentation for JReviews 3 is still a work in progress.
Server Requirements
- PHP 7.0, 7,.1
- 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.
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:
Available PHP Classes and Variables
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 |