Posts Tagged ‘bug’

Concrete 5 SQL errors during installation

Friday, February 3rd, 2012

We have seen this error with Concrete 5.5.1

You try to setup Concrete 5, and get strange SQL errors during the installation:

If installing with an empty site, like this

c5-nosample-content-chosen

you get:

c5-mysql-error

mysql error: [1048: Column 'uID' cannot be null] in EXECUTE("INSERT INTO Config (cfKey,cfValue,uID) VALUES ('NEWSFLOW_LAST_VIEWED','FIRSTRUN',NULL)")

If installing with Sample content with Blog:

c5 with sample content

The error you get is:

Catchable fatal error: Argument 1 passed to ContentImporter::importPageAreas() must be an instance of Page, boolean given, called in /concrete/libraries/content/importer.php on line 75 and defined in /concrete/libraries/content/importer.php on line 197.

 

Solution:

You don't run Varnish by any chance, do you? We do, and we had it set up to … dispose of some cookies. The solution is, in Varnish' case, to enable pass-through for the host you are installing on.

You want to enable cookies.

 

Explanation:

The code which breaks is located in concrete5.5.1\concrete\models\package\starting_point.php

Config::save('SITE', SITE);
Config::save('SITE_APP_VERSION', APP_VERSION);
$u = new User();
$u->saveConfig('NEWSFLOW_LAST_VIEWED', 'FIRSTRUN');

As you see, this is the first time a User is created and used.

The User class is defined in concrete5.5.1\concrete\models\user.php

if (isset($_SESSION['uID'])) {
$this->uID = $_SESSION['uID'];
$this->uName = $_SESSION['uName'];
$this->uTimezone = $_SESSION['uTimezone'];
if (isset($_SESSION['uDefaultLanguage'])) {
$this->uDefaultLanguage = $_SESSION['uDefaultLanguage'];
}
$this->superUser = ($_SESSION['uID'] == USER_SUPER_ID) ? true : false;
} else {
$this->uID = null;
$this->uName = null;
$this->superUser = false;
$this->uDefaultLanguage = null;
$this->uTimezone = null;
}
$this->uGroups = $this->_getUserGroups();
if (!isset($args[2])) {
$_SESSION['uGroups'] = $this->uGroups;
}
}

The constructor checks in the Session for a valid user ID. If no user ID is found, it is set to zero. This happens if you throw away the cookies! Because the session is stored in them.

HTH. Feel free to comment on similar errors and solutions.

Enable and fix Lectora titles for the Opera browser

Friday, June 17th, 2011

Problem: If you publish a title with Lectora, and try to view it from Opera, instead of the title you see an error message

Your browser does not support dynamic html. Please download a current version of either Microsoft'" DESIGNTIMESP=18189>Microsoft Internet Explorer or Mozilla'" DESIGNTIMESP=18192>Mozilla Firefox and try visiting our site again. Thank You.

Solution: You have to modify trivantis.js in line 353 and line 355. The modifications are displayed in bold

this.ns = (name=="ns" && this.v>=4)||(navigator.userAgent.indexOf("Opera")!=-1)
this.ns4 = (this.ns && this.v==4)
this.ns5 = (this.ns && this.v==5)||(navigator.userAgent.indexOf("Opera")!=-1)

IMPORTANT: WordPress fucks up the quotation marks above, fix them by hand!!!

This tells Lectora's code to treat Opera like Netscape Navigator and its derivates. For the title we are developing for the WHO (ICF eLearning tool) it works flawlessly.

This fix is taken from this Lectora forum message, posted by ssneg.

(ssneg also explains why it is not possible to override this.min and set it to true – because Lectora only includes code for IE or NS to display the title contents, like buttons, later on. Thus we need for Opera to "pretend" that it is Navigator. The code works.)

Do you know any other browsers incompatible with Lectora? Please post a comment, and we might find a solution :-)!

 

InDesign crashes when unlocking several guides

Wednesday, May 4th, 2011

It does not matter, whether you try to unlock the guides on your master layout pages one by one – saving inbetween – or whether you select all of them, and try to unlock them together – InDesign CS 5 will crash. I do not know what causes this particular error, but I know a workaround:

Unlock one guide, save and close. Reopen the document, unlock the next guide, save and close. Repeat.

Btw, InDesign crashes when trying to lock the guides, even before locking the first one. Anyone knows a solution for this? (Apart from switching to Quark XPress, of course ^_^)

Fix for weird bug

Sunday, April 3rd, 2011

Lectora inserts anchors (<A name=""> elements) which sometimes can break things!

I have programmed exercises with a sliding animation from "page" to "page" of exercises using the Scrollable from JQuery Tools. It would work fine in an older FireFox, but broke apparently in the newest version, it newer worked in Chrome, but it works in IE. The exercises would jump to the last page, skipping over everything in between.

After one hour of debugging I found out that an additional <A></A> element had to be inserted in each "page" of the exercises. (I do it programmaticaly using PHP.) Now all items show up … with an additional item (depending on the browser).

This additional item is an anchor inserted by Lectora. There's no use putting code to take it out again to run on page load, as Lectora's code seems to run later. You have to run your code as soon, as the user triggers an action, just at the beginning of it to clean up.

//fixing Lectora interfering with our code …
$("#exercise > .items > a").remove();

A simple fix for a complex problem … Lectora does require a lot of workarounds.