development blog for the wicked stuff we encounter

I’ve recreated a website for my friend using the Joomla portal-framework, the successor of the late Mamboo portal-engine. I personally think it is a bit over-rated, not an easy-to-use system at all.

One huge error I found with the 1.5 install: the search got mixed up somehow, and it failed with the following error message:

Fatal error: Call to undefined method SearchHelper::checknohtml() in /plugins/search/content.php on line 254

..and of course there were no checknohtml() functions in any of the directories.

So i’ve downloaded the last stable version, and found out that originally, this function must live in the ~/administrator/components/com_search/helpers/search.php file. So i’ve just copied over the old file, and voila: it’s working.

I use Asp.Net DynamicData frequently, because it really speeds up development in a confortable way for some kind of projects. I'm using the DynamicData Futures July edition, and it has beautiful features like Ajax enabled DateTime UI, custom Where clauses, and Insert parameters etc. But it has some GUI design flaws: 1) the Child relations' text occupies way too much space, and makes it unreadable I've added some simple PNGs from the WebAppers Icon Set to make it more vivid for the end user. Download the icon set, and select the icons you like. The template files can be found under ~/DynamicData/FieldTemplates/ The Child relations file is named Children.aspx,  the codebehind file is Children.aspx.cs. In the Page_Load event of the codebehind, i simply commented out the name setting of the child table, because it's already in the Table header:
        protected void Page_Load(object sender, EventArgs e) {
            //HyperLink1.Text = "View " +ChildrenColumn.ChildTable.GetDisplayName();
            //InsertHyperLink.Text = "Insert " +ChildrenColumn.ChildTable.GetDisplayName();
        }
and in the aspx file, I've added the icons, and removed the two objects referred in the aspx.cs:
view 
insert


insert 
insert

Back in the codebehind file, you need to replace the reference to HyperLink1 to InsertLink:
        public override Control DataControl {
            get {
                //return HyperLink1;
                return InsertLink;
            }
        }
Build, and see in action: dinamicdatawithicons1 You can do it with ForeignKeys as well - I choose the Next type icon for the outer reference. 2) the GridView controls are missing the GridViewAlternateRows settings Simply do a text search for "asp:GridView", and add AlternatingRowStyle-CssClass="even" to every occurence. If you finished, create a new CSS class in ~/Site.css:
.even {
    background-color:#eeeeee !important;
    background: #eeeeee  !important;
}
This will work in every major browsers :)

I simply can't understand Microsoft, how they can ship Internet Explorer AGAIN with a silly PNG alpha-channel bug. I added a PNG-24 image to the homepage (get in touch button) and IE simply failed to display the border images' Alpha channel, if they are used as background-image from CSS. I thougt it was an IE6 problem only, but no: IE7 still does not know how to handle properly, so I switched back to the good old IE PNG Fix library from TwinHelix to do the work. Update: If you're using IE6 and IE7 on the same machine, IE7 will report itself as IE6 too - so make sure to add the [If IE] clause.

Visual Studio 2008 keeps me entertained all day long:) I have a really complicated project, with several tables and views and stored procedures hooked upon it. I'm using XSD as an intermediate abstraction layer. The error message "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints" kept haunting me for days; I double checked anything:
  • there were no duplicate keys whatsoever
  • there were no NULL values, I experienced with IsNull(..) for fields
  • even empty tables had this error.
Finally, I figured out, that and any changes to the database schema, even the change of the length of any column triggers the above error, the XSD Schema simply does not recieve the changes; even when I click Refresh Schema. The one and only working solution is to open the given XSD file, and simply delete and re-add the errorous object.

Possibly every web developer in his/her lifetime faces with a common DOM error: in IE/Opera the getAttribute() function works as expected for a given item, but in Firefox it misteriously somehow says it's not a function, or the direct reference to the node object's attributes returns undefined value. The problem is, that Firefox's DOM handling generally differs from IE's MSXML DOM method. Basically, in Firefox every node has more nodes as it seems. For example see the following sniplet: <div id="first"><a href="http://skaelede.hu">text</a></div> if you want to query the href attribute of the a node, you'd say: document.getElementById("first").childNodes[0].getAttribute('href') in IE, it works flawlessly, but FF will break completely! Why? Because as it seems, the "a" node is the only child of the div, but in reallity, it is not. Let's face it: we forgot one element: the div text itself, what is currently empty! This will be the first node, and of course it can't have any attributes. To work around this problem, first we should loop through all childs in this simple nodeset as well. In step 2, we need to look up the given childNode's nodeType, if it's a suitable element node: var l = document.getElementById("first"); if (l.hasChildNodes()) { for (i=0;i<l.childNodes.length;i++) { var m = l.childNodes[i]; if (m.nodeType == 1) { var n = m.getAttribute('href'); } }