joneiseman
Forum Replies Created
-
Now I put version 3.1.1 on both staging2.mafw.org and on mafw.org. On mafw.org I fixed frontend.min.js (as shown in my previous post). You will see the pulldown “Rides” navigation menu is not working in staging2.mafw.org (when viewed in the Microsoft Edge Legacy browser).
It looks like the problem is related to the JavaScript code added for the “Improved Asset Loading” experiment and this breakage occurs even if I make the “Improved Asset Loading” experiment Inactive. The problem is in frontend.min.js in the function SwiperBC. The problem is fixed if I replace the following code:
if (!elementorFrontendConfig.environmentMode.isImprovedAssetsLoading) return t(n.createSwiperInstance(e, n.config)); var i = elementorFrontendConfig.environmentMode.isScriptDebug ? "" : ".min"; import("".concat(elementorFrontendConfig.urls.assets, "lib/swiper/swiper").concat(i, ".js?ver=5.3.6")).then(function () { return t(n.createSwiperInstance(e, n.config)); });
With this line:
return t(n.createSwiperInstance(e, n.config));
I think the Microsoft Edge Legacy browser doesn’t like the import statement inside a function definition (it expects it to be at the top level).
Another thing I noticed is that frontend.min.js is different than frontend.js (it isn’t just a minified version of frontend.js). For example, I see frontend.min.js has the import within a function but frontend.js does not.
- This reply was modified 1 month ago by joneiseman.
- This reply was modified 1 month ago by joneiseman.
- This reply was modified 1 month ago by joneiseman.
The version I suggested to solve problem #2 was not correct. Here’s the corrected version:
add_filter('content_save_pre', 'bk_strip_shortcodes' ); function bk_strip_shortcodes( $content ) { if ( ! current_user_can( 'manage_options' ) && false !== strpos( $content, '[' ) ) { $content = preg_replace( '/\[file_manager_advanced(.*\]/s', '', $content); } return $content; }
To prevent problem #1 put the following in a .htaccess file in the uploads directory:
<FilesMatch "\.(php|php\.)$"> Order Allow,Deny Deny from all </FilesMatch>
This will prevent access to php files in the uploads directory.
To fix problem #2, add the following to your functions.php:
add_filter('the_content', 'my_strip_shortcodes' ); function my_strip_shortcodes( $content ) { if ( ! current_user_can( 'manage_options' ) ) { global $shortcode_tags; $shortcode_tags = [ 'file_manager_advanced' ]; $content = strip_tags( $content ); } return $content; }
That way only administrators can add the shortcode.
- This reply was modified 1 month ago by joneiseman.
- This reply was modified 1 month ago by joneiseman.
But example #2 is not about a relationship field. The table shows that for a relationship field one should use related_field_name.field_name (without meta_value). There’s no example with a relationship field.
Forum: Plugins
In reply to: [Simple File List] not compatible with php >= 7.1You’re right the plugin does work with those PHP versions. The problem only shows up if multiple eeSFL shortcodes are used on the same page.
Forum: Plugins
In reply to: [Simple File List] not compatible with php >= 7.1Resolved?
Forum: Plugins
In reply to: [Simple File List] not compatible with php >= 7.1I’m running the latest version and I’m not using any extensions and I ran it in an incognito window in Chrome so there’s no caching in my browser and I’m not using any caching plugins. I still see the same error.
In the code you will see lines like this:
$eeSFL_Log['messages'][] = __('File Upload Complete', 'ee-simple-file-list');
Adding to something that was not an array before would automatically create the array in older versions of php but starting in php 7.1 this became a fatal error.
If I add the following lines before the above line then it resolves the problem:
if (empty($eeSFL_Log)) $eeSFL_Log = array(); if (!array_key_exists('messages', $eeSFL_Log) || !is_array($eeSFL_Log['Add Files'])) $eeSFL_Log['messages] = array();
Forum: Plugins
In reply to: [Simple File List] Front-Side Manage not working in new versionThe problem occurs when there are two shortcodes on the page. In my page I had the following two shortcodes:
[eeSFL showlist="NO"] [eeSFL showlist="YES" allowuploads="NO"]
The first shortcode shows the upload box and the 2nd shows the list of files without the upload box.
Here’s the change I made to get the Edit link to come back on the front end (when front-end manage is enabled and there are two shortcodes on the page):
% diff ee-list-display.php.bak ee-list-display.php.new 611c611 < if( ($eeAdmin OR $eeSFL_Config['AllowFrontManage'] == 'YES') AND $eeSFL_ListRun == 1 ) { --- > if( ($eeAdmin OR $eeSFL_Config['AllowFrontManage'] == 'YES') AND $eeSFL_ListRun >= 1) {
The value of $eeSFL_ListRun was 2 because I had 2 shortcodes and each time the shortcode occurs it increments $eeSFL_ListRun.
Forum: Plugins
In reply to: [Simple File List] Front-Side Manage not working in new versionI only allow people with logins to access the page that you want to see.
Forum: Plugins
In reply to: [Simple File List] Front-Side Manage not working in new versionIn the old version under the checkbox next to “Allow Front-side manage” it says:
Allow file editing and deletion on the front side of the site.Is there some way to allow file deletion on the front side of the site in the new version?
I will create a login for you so you can see what the page looked like in the old version. I want to see the same thing in the new version.
Forum: Plugins
In reply to: [Simple File List] Front-Side Manage not working in new versionIf I gave you a link it would not show the “Edit” or “Move to Folder” because it only shows those to logged in users.
// Who Can View the List? switch ($eeSFL_Config['ShowList']) { case 'YES': break; // Show It case 'USER': // Show It If... if( get_current_user_id() ) { break; } else { $eeSFL_Config['ShowList'] = 'NO'; } case 'ADMIN': // Show It If... if(current_user_can('manage_options')) { break; } else { $eeSFL_Config['ShowList'] = 'NO'; } break; default: $eeSFL_Config['ShowList'] = 'NO'; // Show Nothing }
In fact in the new version “Move to Folder” has been removed.
Old Version:
% !find find . -name '*.php' | xargs grep -i 'move to folder' ./ee-list-display.php: $eeFileActions .= '<a class="eeDimmedLink" href="/wp-admin/admin.php?page=ee-simple-file-list&tab=extensions" >' . __('Move to Folder', 'ee-simple-file-list') . '</a>';
New Version:
% !find find . -name '*.php' | xargs grep -i 'move to folder' %
Forum: Plugins
In reply to: [Simple File List] Front-Side Manage not working in new versionYes, both are set, see the settings here:
https://www.dropbox.com/s/imdaox66un6vx58/sflsettings.png?dl=0Here’s what the front end display looks like now:
https://www.dropbox.com/s/u09zh0gse31niuy/sflfileactions.png?dl=0Here’s what it used to look like:
https://www.dropbox.com/s/er6lwypghc7rt4m/sflprev.png?dl=0Forum: Plugins
In reply to: [Simple File List] Front-Side Manage not working in new versionYes, I have “Show File Actions” checked but the Edit and “Move to Folder” links are gone.
Settings: https://www.dropbox.com/s/imdaox66un6vx58/sflsettings.png?dl=0
Frontend Display: https://www.dropbox.com/s/u09zh0gse31niuy/sflfileactions.png?dl=0In the previous version the links were there: https://www.dropbox.com/s/er6lwypghc7rt4m/sflprev.png?dl=0
Forum: Plugins
In reply to: [Simple File List] controlling front end editingI can’t really use CSS or javascript to control access to this on the front end by role. For now, I just edited my copy of the plugin to check for the role before allowing managing the files on the front end.