Posts Tagged ‘fix’

Privoxy rules to unblock Concrete 5 editing

Friday, May 20th, 2011

In Concrete 5, TinyMCE is used as an editor for Content blocks. If you have Privoxy installed with the default settings, crucial parts of this editor will be blocked, and you would be unable to edit the Content block properly. (no editor appears, you see a small box with the HTML instead).

You can verify that it's indeed Privoxy which is doing it, by checking the Network tab of Dragonfly or Firebug in Opera or FireFox, Privoxy will add a status message to files which have been blocked.

To fix this problem, edit your user.action file (located in the application's toplevel directory), and add a new line under the { fragile } section:

{ fragile }
#.forbes.com
/concrete/js/tiny_mce/plugins/.*
/updates/concrete.*

This should unblock all Concrete 5 – based sites.

Update (23.10.2011): The fix now works with updated Concrete 5 sites.

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.

Apache 2 not starting

Tuesday, March 22nd, 2011

After doing a apt-get upgrade your Apache does not start / does not serve connections? Read on!

somesystem.root# /etc/init.d/apache2 start
Starting web server: apache2[Tue Mar 22 18:18:02 2011]
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
failed!

Binding to adress 0.0.0.0:80 means accepting all connections. There is nothing wrong here, nor probably in the Apache setup files – which have been correct before.

The error can be caused by Apache 2 already running! Try ps awx to see all processes, look for Apache 2 and perhaps rotatelogs.

After killing the processes using kill -9 pid_one pid_two (replace pid_one pid_two with the appropriate process ids – you can specify multiple at once) try starting apache again (using apache2ctl -k start for instance).

This time Apache should start without problems. But it will not serve requests, and the Apache PID may not be written. (Thus, apache2ctl will assume that Apache is not yet running!)

Check your error log for the last entries. In my case the following entry was the key to fixing the problem:

PHP Warning: [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.6-1+lenny3. Rebuild it for your PHP version (5.2.6-1+lenny10) or download precompiled binaries.

in Unknown on line 0
PHP Fatal error: Unable to start eAccelerator module in Unknown on line 0

PHP's error was blocking the whole Apache! The quick solution for this particular problem (yours may be different) was to edit /etc/php5/apache2/php.ini and comment the lines setting up eAccelerator. (You need to use ";" as comment character for this file).

After the fix, killing the running Apache process(es), and starting Apache again, it resumed normal operation.

IFRAME z-index

Wednesday, February 23rd, 2011

If you have an absolutely positioned IFRAME with a lower z-index than another DIV you want to show in front of it, this other DIV also needs to be positioned absolutely for the z-index to work correctly.

The absolute positioning takes precedence over the z-index. Relatively positioned elements are always positioned behind absolutely positioned elements.

Lectoras external HTML object and z-index

Sunday, February 20th, 2011

Given the limited flexibility of Lectora, in some cases you need to include custom scripted HTML objects.

For instance you want to build an overlay for a login dialog, which would communicate directly with the server using AJAX.

After positioning your external HTML object on the page and building the HTML you want to include (by i.e. a PHP "include" call), sometimes you will find Lectora is putting other things on top of your HTML object's contents.

The first possibility to fix this would be modifying Lectora's "Layering" option of your object: "Bring to Front".

The second possibility comes in handy, if you do not want to modify the Lectora project itself: on-the fly z-index – updating.

I use the JS library JQuery to efficiently work on the DOM across browsers. Using it, you can set the z-index during runtime (i.e. reacting to a mouseclick on an icon):

$('#object-name').css('z-index','1000');

You can find out the name of the DIV Lectora creates for your external HTML object using Firebug, or looking up the object name property in Lectora (double click your object to see the settings dialogue).

Creating DIVs inside your Lectora object and setting their z-indices to higher values, i.e. by CSS, does not work. You need to alter the z-index of the wrapper DIV provided by Lectora. It is created during run-time using this code:

object-name = new ObjInline('object-name',null,0,580,900,40,1,15,null,'div')
object-name.build()

The Lectora code sets the z-index! Thus, your z-index from the CSS would be ignored, and you need to update it during runtime, as I have described above.

Zimbra upgrade without tears

Sunday, January 23rd, 2011

The Zimbra installer uses an utility script to find out your distro and release:

/bin/get_plat_tag.sh

And the output of this determines which prerequisites the installer expects. This list of prerequisites is coded in

/util/utilfunc.sh

(search for "UBUNTU8" for instance)

In some cases, as in mine, this get_plat_tag.sh script may not detect your distro and/or version correctly which may lead to screw-ups with required prerequisites. You may want to use this dirty hack to solve the problem: modify the get_plat_tag.sh script at the very beginning to echo the distro and release you want (actually need) it to echo by inserting:

#quickfix
echo "DEBIAN5_64"
exit 0

You may find yourself running into missing requirements, in my case it was MISSING: libgmp3 – although I can't install this package (I have to use libgmp3c2 which was already installed and is the correct requirement for other distros). After setting the correct distro and release the installation was without problems!

PDFs mit XMind anzeigen

Wednesday, January 19th, 2011

Falls Adobe Reader die PDFs aus XMind direkt nicht öffnen möchte:

In Adobe Reader muss der "Geschützte Modus abgeschaltet werden"

Unter dem Menü Bearbeiten->Voreinstellungen->Allgemein

Häckchen bei "Geschützten Modus beim Start aktivieren" weg

Zimbra Stats not working?

Friday, November 26th, 2010

In Zimbra Release 6.0.6_GA_2324.DEBIAN5_64 UBUNTU8_64 FOSS edition I had the problem, that a zmcontrol status would always show the service stats as stopped, no matter how often you would stop and start all services. After reading a bit on the Zimbra forums, I managed to fix that.

Do (as root):

chown -R zimbra:zimbra /opt/zimbra/zmstat

/opt/zimbra/bin/zmsyslogsetup

These are the two commands you need to run. After that, su zimbra to become the user zimbra and zmcontrol stop and zmcontrol start your server. Voilá, zmcontrol status should now show the stats as running.

Apparently the problem is, that some directories stats tries to access are set up incorrectly with the owner root instead of Zimbra. The error is reported to randomly occur again, so you may need to repeat the chown part.

Also see these websites for further details:

Windows 7 Hibernation Problems

Monday, November 22nd, 2010

When I run cmd.exe as Admin ("elevated command prompt"), and enter

powercfg -h on

I get this error: "The system could not create the hibernation file. The specific error code is 0xc0000043."

Developing with Concrete: New Block Type not showing up

Wednesday, November 17th, 2010

Problem: you are adding a new block type to your package. You are updating the package using Concrete's update functionality, but no new block type shows up.

Solution: remove the package completely (uninstall – but leave it in the package directory, when C5 offers to move it to trash!), and install it again. Your block type should show up now.