File Block - Gives error v5.4.2.1 and 5.4.2.2 (two seperate installations)

Permalink
Version: 5.4.2.1 & 5.4.2.2

When I am adding a file using the File Block, after I have clicked "Add" all I get is an Error pop up. There is no detail in the error pop up. It's blank... two questions:

1. Does anyone have the same problem?
2. How to I actually SHOW the error in the pop up so I can fix it?

File permissions are set correctly and I am experiencing this same error in both versions. Two separate installations and also happens on windows or linux servers.

Thanks

 
JohntheFish replied on at Permalink Reply
JohntheFish
For diagnostics, try dashboard > sitewide settings > debug > debug level > development.

On the same dashboard page, you can also set 'log application exceptions' and then view the log at dashboard > reports > log.
beingalex replied on at Permalink Reply
Hi John

I have found the problem:

\helpers\validation\error.php

I am over-riding the concrete5 core version of the above file with my own:

defined('C5_EXECUTE') or die("Access Denied.");
   class SiteValidationErrorHelper {
      protected $error = array();
      /** 
       * this method is called by the Loader::helper to clean up the instance of this object
       * resets the class scope variables
       * @return void
      */
      public function reset() {
         $this->error = array();
      }
etc. etc. etc. My stuff...



It is something to do with having to call the class SiteValidationErrorHelper. This is a bug I think as you are directed to call the class SiteValidationErrorHelper

I have reported it in the bug tracker.
JohntheFish replied on at Permalink Reply
JohntheFish
Out of curiosity, I would be interested to hear why you are replacing or extending the validation helper, and what you are actually validating differently, or in addition to, what validation is already provided.
beingalex replied on at Permalink Reply
Hi John

I wanted to make all our sites output a nicer validation error notice. So I just edited the output method.

public function output() {
    if ($this->has()) {
        print '<ul class="ccm-error">';
        print '<span class="top left notice corner"></span><span class="top right notice corner"></span>';
        print '<span class="bottom left notice corner"></span><span class="bottom right notice corner"></span>';
        print '<h3>Please correct the '.count($this->getList()).' problem'.(count($this->getList()) > 1 ? 's' : null).' below:</h3>';
        foreach($this->getList() as $error) {
            print '<li>' . $error . '</li>';
        }
        print '</ul>';
    }
}