Cannot edit CMS.

Permalink
Hi there
Urgent help required.
I cannot get to my site (http://www.apokoronas365.com ) to even log in as an error message blocks me. The error logs show this:
13 Nov 2017, 17:10:50 Exceptions Guest Exception Occurred: /vhost/vhost16/a/p/o/apokoronas365.com/www/updates/concrete5.7.5.13_remote_updater/concrete/src/File/FileList.php:155 Call to a member function getFileSetID() on null (1)
13 Nov 2017, 16:50:10 Exceptions admin Exception Occurred: /vhost/vhost16/a/p/o/apokoronas365.com/www/updates/concrete5.7.5.13_remote_updater/concrete/src/File/FileList.php:155 Call to a member function getFileSetID() on null (1)

What do I do ?
Many thanks for any help.
Redtel.

tjbphoto
 
jero replied on at Permalink Reply
jero
At a guess, you've got a block somewhere that is trying to use a file set that has been deleted or removed. It could be a slide show block I would imagine.

You'll need to enable some debugging to find out which one it is.

You'll need an FTP client or cpanel file manager, to edit this file:

application/config/generated_overrides/concrete.php

you may see code similar to below:

'debug' => array(
        'detail' => 'debug',
        'display_errors' => true,
    ),


if you do, edit them so that they look like the above. If not, add them in. Note the trailing comma.

**Make a backup of this file before you start**

Once this is in place, you should get a much more informative debug trace and you should be able to figure out which piece of code is crashing. Once you've done that, you can probably comment out the affected section and then remove the block before removing that change.
tjbphoto replied on at Permalink Reply
tjbphoto
Many thanks for your reply.
As soon as I saw this I remembered that I was trying to establish a table in a block.
$expr = $this->query->expr();
        $this->query->andWhere(call_user_func_array(array($expr, 'orX'), $expressions));
        $this->query->setParameter('keywords', '%' . $keywords . '%');
    }
    public function filterBySet($fs)
    {
        $table = 'fsf' . $fs->getFileSetID();
        $this->query->leftJoin('f', 'FileSetFiles', $table, 'f.fID = ' . $table . '.fID');
        $this->query->andWhere($table . '.fsID = :fsID' . $fs->getFileSetID());


Sorry to be a pest, but what should I do now ?
Many thanks in anticipation of your reply.
jero replied on at Permalink Reply
jero
I'd be inclined to add
return;


at the very start of the block's controller view() and on_start() methods, or any other methods that might be getting called when a page renders. That should stop the block from crashing the site and you can then remove the block from the page(s).

Alternatively, you can try adding

if (! is_object($fs)) return false;


to the *first* line of your filterBySet() method. That should stop the error, but it may cause other issues with the rest of your code, I can't really tell because I can't see the rest of it.
tjbphoto replied on at Permalink Reply
tjbphoto
It's me again.
Is this found in public>concrete>blocks>content

As the table is a feature of the content block.
controller code is:
CODE REMOVED TO SAVE SPACE

You can guess I'm a bit new to concrete5.
Many thanks.
jero replied on at Permalink Reply
jero
You'd need to make the changes I proposed in your custom block. The code you've posted is the standard content block and I would not expect changes in there to make any difference.

Where exactly did you add the filterBySet method?
tjbphoto replied on at Permalink Reply
tjbphoto
Hi
I was looking to do your first advice.
I am new to this and not sure where everything is stored. I am confused by the error as the table that I added to the content block in a stack, was deleted almost immediately and I was editing for an hour or so afterwards.
It was only when I tried to log in initially that the error ocurred. Since then I cannot seem to even get the log in page even though I cleared all the cache from the browser.
I would greatly appreciate the string to find where to place your suggestions.
Many thanks.
jero replied on at Permalink Reply
jero
http://www.apokoronas365.com/index.php/login brings up the usual login page when I try, so that looks promising. Can you actually log in?

The error report is not as informative as I'd have expected though. Normally there would be a traceback all the way to index.php. it makes me wonder if there's a broken update - I note the file that's crashing is an update
tjbphoto replied on at Permalink Reply 1 Attachment
tjbphoto
Good morning Jero
A beautiful sunny morning here on Crete. Hopefully it will be a good day.

Now that my screen printer is working I've attached a screenprint which offers a bit more info.
When I log in this is the screen that I get.

Terry
tjbphoto replied on at Permalink Reply
tjbphoto
Hi again
Another thing that I've just noticed. On the day this fault happened the update folder received concrete5-8.2.1 folder. Could this affect the site.
Regards
tjbphoto replied on at Permalink Reply
tjbphoto
Jero
This is the code from that filelist:

<?php
namespace Concrete\Core\File;
use Concrete\Core\Search\ItemList\Database\AttributedItemList as DatabaseItemList;
use Concrete\Core\Search\PermissionableListItemInterface;
use Concrete\Core\Search\Pagination\PermissionablePagination;
use Concrete\Core\Search\StickyRequest;
use Database;
use Core;
use Doctrine\DBAL\Query;
use Pagerfanta\Adapter\DoctrineDbalAdapter;
use \Concrete\Core\Search\Pagination\Pagination;
use FileAttributeKey;
class FileList extends DatabaseItemList implements PermissionableListItemInterface
{
    public function __construct(StickyRequest $req = null)


Terry
jero replied on at Permalink Reply
jero
That's a core file and isn't really very helpful. It's something in one of your themes or blocks that's provoking the error. I'm not sure what.

If you would like to PM me with your hosting details and your concrete5 admin login I will be happy to take a look at the problem.
jero replied on at Permalink Best Answer Reply
jero
OK, the problem was that your Wall Gallery Suite package, wall gallery block was looking for a file set which appears to have been deleted.

It wasn't smart enough to check that before trying to use the non-existent set as a filter. It would be a really good idea to ask the package author to fix the issue (which is is in the block controller's view method) so that nobody else falls down the same hole:

function view(){
        $fsID = $this->fileset;
        $bID = $this->bID;
        $db = Database::connection();
        $existingThumbs = $db->GetAll('SELECT * from btWallGalleryThumb WHERE bID = ? ORDER BY sort', array($bID)); //gives us all the files we've already saved/sorted
        $existingThumbIDs = array();
        foreach($existingThumbs as $thumb){
            $existingThumbIDs[] = $thumb['fID'];
        }
        $fs = FileSet::getByID($fsID);
// My fix
      if (! is_object($fs)) {
         $this->set("items",array());
         return false;
      }


It should be working now but you might want to find the pages where the block is in used and remove them or select a new file set.

By the way, you should ask your hosting company to upgrade you to PHP 7 - you're using PHP 5.6 and it's really quite slow. PHP7 is a lot faster.
tjbphoto replied on at Permalink Reply
tjbphoto
Jero
You are a marvel ! Thank you so much.
Redtel.
jero replied on at Permalink Reply
jero
You're welcome. Please do ask the package author to add the fix though.