Login error display

Permalink
When I use my theme to wrap the login/register, etc, pages, if I enter an invalid login, it isn't showing the error message. It works if I'm not wrapping in my theme though. Am I missing something?

Deladroid
View Replies: View Best Answer
Job replied on at Permalink Reply
Job
Embed this one your view.php for Login.

<?php  if (isset($error) && $error != '') { ?>
      <?php  
       if ($error instanceof Exception) {
          $_error[] = $error->getMessage();
       } else if ($error instanceof ValidationErrorHelper) { 
          $_error = $error->getList();
       } else if (is_array($error)) {
          $_error = $error;
       } else if (is_string($error)) {
          $_error[] = $error;
       }
       ?>
      <ul class="ccm-error">
      <?php  foreach($_error as $e) { ?><li><?php echo $e?></li><?php  } ?>
      </ul>


Hope this helps - be sure to mark it as an answer if it does.

Job.
Deladroid replied on at Permalink Reply
Deladroid
I'm not using a custom view.php for login. I only set the config file to use my theme as a wrapper for the existing login (register, etc.). Do I need to create a view.php? Thanks.
Job replied on at Permalink Reply
Job
I guess so!
Deladroid replied on at Permalink Reply
Deladroid
Hmm, seems I found a road block. So I did have a view.php file in my themes folder. I tried adding that code block to it before the <innerContent> php tag, but then the page didn't display at all.
mhawke replied on at Permalink Reply
mhawke
Can you explain a bit more about how you're going about creating this login page?

The reason I ask is that the 'normal' way is to override the core login page by putting a copy of the login.php file found at "root/concrete/single_pages" into "root/single_pages" and start tinkering from there.

I'm sure there are a gazillion other ways to make a custom login page but why re-invent the wheel. ;)
Deladroid replied on at Permalink Reply
Deladroid
All I did was set the commented out override in site_theme_paths.php to be active and changed the theme location to the active theme. The login/register pages were then wrapped in the custom theme. However, the error display is not working.
mhawke replied on at Permalink Reply
mhawke
Sounds reasonable. I guess it depends on how much customizing you want to do. Here are a couple of forum discussions that might help.

http://www.concrete5.org/community/forums/themes/customizing-login-...

Video explanation by Tallacman:

http://performancec5.com/how-to/styling-the-login-page/...
mhawke replied on at Permalink Reply
mhawke
If you're still having trouble with this, could you attach your view.php so I could have a look at it? You might have to rename it view.txt to attach it in these forums.
Deladroid replied on at Permalink Reply 1 Attachment
Deladroid
I noticed the same issue on another site, so I'm missing a step to be able to completely wrap the login/register pages in my theme. I attached view from the original site in question.
mhawke replied on at Permalink Reply
mhawke
I guess I need your header.php and your footer.php as well to get the whole picture.
Deladroid replied on at Permalink Reply 2 Attachments
Deladroid
Here are the header and footer too.
mhawke replied on at Permalink Reply
mhawke
What display problems are you having. Can you post a screenshot?

You don't have any open tags but you have used '<ul id="subnavlist">' in 3 different places. ID's must only be used only be used once per page. I believe this will cause the css to only style the first element. Since these <ul>'s are in your nav, I'm pretty sure your nav will not display properly. You might already know this but to fix it, change them to '<ul class="subnavlist">' in your HTML and change the css so that #subnavlist becomes .subnavlist.

One quick question that's off topic... Is there a reason why you are hard-coding the navigation structure? Part of the beauty of C5 is that the autonav block handles all the menu structure so that when you add pages to your site, they automagically get added to your navigation structure.
Deladroid replied on at Permalink Reply
Deladroid
I'm just not getting the error message when a login is invalid. I'll reply with screen shot, but there's nothing to show as the page looks like it just refreshes on invalid login attempt.

Thanks on the multiple <ul id=subnavlist> tags. I will fix that.

I was on a deadline and am still new to c5, so after trying to get the jquery nav menu to work right using the autonav block, I switched to hard coding. I will try again now that I have more time.

Thanks!
mhawke replied on at Permalink Reply 1 Attachment
mhawke
I'm not finding any glaring issues that would stop the error messages from showing up but I would try to simplify things to try to troubleshoot this.

I have attached a very simple view.php file. Try temporarily renaming your view.php and placing the attached view.php file in your theme directory and see what happens.

This file does not call your header.php or footer.php so you won't have your navigation. It's just to try to cut out as many variables as possible so we can find the culprit.
Deladroid replied on at Permalink Reply
Deladroid
Hmm, interesting.

So I put your view.php code in place of my theme's view.php, and no change to the login or register pages (doesn't appear to be using my view.php file or something). Still doesn't show errors also.

I cleared cache and reinstalled theme through dashboard, to be sure.

Edit: Grr, hold-on, it doesn't look like my upload change for view.php took.

Edit2: Ok, Dreamweaver wasn't updating the file, so I just updated it using FileZilla. You can see by entering a random (non registered user) that it doesn't show any error messaeges:
http://digital-nw.com/pndc/c5/index.php/login/do_login/...
mhawke replied on at Permalink Reply
mhawke
You're going to be upset...

Try this:

Try to log in with a bad login. After the page refreshes, use your mouse to highlight the area just under your "Reset and Email password" button.

Your error message shows up as black text on a black background.
Deladroid replied on at Permalink Reply 1 Attachment
Deladroid
I could hope for it to be that! (and it may still be), but here is what I see after I click sign in after entering a bad login (attached).

It's all the default text (no error messages).
mhawke replied on at Permalink Reply
mhawke
You're right, I got excited!! I thought I was seeing the error response back. Sigh!
Deladroid replied on at Permalink Reply
Deladroid
I got excited too lol. Thanks for the help.
Deladroid replied on at Permalink Best Answer Reply
Deladroid
First, thanks to Job, as he was on the right track, but I guess Concrete5 uses the following tag for newer versions:
<?php Loader::element('system_errors', array('error' => $error)); ?>

This did the trick. I missed this when I was searching documentation previously. Thanks for all your replies!
mhawke replied on at Permalink Reply
mhawke
AAGH! I don't know how I missed it. The view.php I attached a couple of posts ago was a stripped down version of my actual view.php. When I saw your solution, I checked my full view.php and that magical line is in there:

<div id="body">   
<?php Loader::element('system_errors', array('error' => $error)); ?>
<?php print $innerContent;?>
</div>


I stripped it out trying to eliminate as many variables as possible. Sorry, I cost you a few days.

Glad it's working.