Adding File Picker content crashes page

Permalink Browser Info Environment
Hi. I purchased your add-on, which installed without issue, earlier this week. When I add content to a block, everything seems to be fine during the process, but when I click the "Add" button to save/submit the File Picker window, it looks like it works, but nothing shows up in the target block, and if I publish the page, then it looks like it breaks permanently. From that point on, navigating to the page results in the following output:

An unexpected error occurred.
The use statement with non-compound name 'Page' has no effect

with a "Back to home" button. How do I resolve this issue? Thanks.

Type: Pre-Sale
Status: In Progress
Pepperhead
View Replies:
Justin1978 replied on at Permalink Reply
Justin1978
Hi Pepperhead,

I'm sorry to hear you are experiencing problems with one of my add-ons. Could you first tell me what version of Concrete you are using and what version of the add-on?

I think I know what is going on because I've seen errors like this before when working with php. There's probably going to be a use-statement like this in one of the files:
use \Page;


Because Page is an alias to \Concrete\Core\Page\Page using 'Page' with a backslash in front of it will sometimes give errors like this with certain server server or php configurations I noticed, even though this is the proper way to write a use-statement. I haven't had this error myself so it might be your configuration.

But if you supply me with the versions used I'll fix the problem and upload a new version.
Pepperhead replied on at Permalink Reply
Pepperhead
Thanks for your quick attention, sir.

# concrete5 Version
Core Version - 8.2.0
Version Installed - 8.2.0
Database Version - 20170711151953

# concrete5 Packages
File Picker (2.0)
Justin1978 replied on at Permalink Reply
Justin1978
I found the use-statements that are most likely causing the error. Are you proficient with php? Then you could remove the use statements to fix the bug temporarily. I also want to know if this solves the problem.

All you have to do is open the 2 template files from the block and remove the following line from those files at the top of those files:
use \Page;


The template files are:
- /packages/file_picker/blocks/file_picker/templates/table/view.php
- /packages/file_picker/blocks/file_picker/view.php

So all you have to do is remove those lines. You can also comment them out by adding two forward slashes in front of the statements, like this:
//use \Page;


Let me know if this solves your problem. Then I will release a new version with the bug fix.
Pepperhead replied on at Permalink Reply
Pepperhead
That did the trick!

Thanks much for your time and effort!

concrete5 Environment Information

# concrete5 Version
Core Version - 8.2.0
Version Installed - 8.2.0
Database Version - 20170711151953

# concrete5 Packages
Cloneamental (0.9.3), Event Calendar (3.4), File Picker (2.0), List files from set (1.0.13), Neat (0.9.2), Stucco (2.1.3)

# concrete5 Overrides
None

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
5.6.31

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, enchant, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imagick, imap, intl, ionCube Loader, json, libxml, magickwand, mailparse, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, OAuth, oci8, odbc, openssl, pcre, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, Reflection, session, SimpleXML, snmp, soap, sockets, SourceGuardian, SPL, sqlite3, standard, tidy, tokenizer, uploadprogress, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend Guard Loader, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 256M
post_max_size - 64M
sql.safe_mode - Off
upload_max_filesize - 64M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
oci8.max_persistent - -1
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.