Tuesday, January 29, 2013

Bootstrap Modal Double Backdrop

I recently had an issue where I was getting the modal-backdrop class applied twice, so I ended up with two overlays.

Symptoms

Upon calling .modal(), I ended up with a very dark background overlay. Dismissing the modal cause the overlay to lighten but remain. Clicking somewhere on the page or pressing ESC caused the overlay to vanish.

Method

This was occurring whenever I loaded the entire content of the modal with AJAX. Something like:


function makeModal(html) {
        var $modal = $(html);
        $('body').append($modal);
        $modal.modal();
    }

The problem is that html had a script tag present, so $modal.modal(); was actually being applied to the modal div and the script tag.

The Fix

You need to make sure you only apply modal() to the modal  div, like this:

function makeModal(html) {
        var $modal = $(html);
        $('body').append($modal);
        $modal.filter('.modal').modal();
    }

I found the answer to this problem via landon's post on this github issue: https://github.com/twitter/bootstrap/issues/679

Friday, January 25, 2013

Confluence: Failed to create the user X. Check your server logs for more information.

I recently received this error when trying to create a new user.

The error was occurring because of the order of my Group Directories.

I have both Confluence Internal Directory and Microsoft Active Directory enabled. The order is important here. Microsoft Active Directory was listed first, so when I was trying to create a new user it was trying to do so in AD.

In my case, I wanted the user to be created in the internal directory, not my AD.

The Fix


  1. Browse -> Confluence Admin
  2. User Directories
  3. Use the green arrows to make it so the Internal directory is first in the list.






You should now be able to create your user!



Tuesday, January 22, 2013

Get a Stack Trace on the Symfony2 Command line (console)

If you run a command via the Symfony 2 Console component and receive an exception, you aren't presented with much more information than the exception name and message.

To see a full stack trace, append -v to your command.

For example:

php app/console doctrine:schema:update --force -v

This will provide a full stack trace. You probably need to have Xdebug installed.