Previously I was confronted with an error while simply using the Drupal l() function. In this l() function I was trying to give the HTML a-tag a specific class attribute value. The following code was in my module:
l(‘some url text’, ‘the-path-for-the-current-active-page’, array(‘attributes’ => array(‘class’ => ‘custom-class’)))
When calling the page containing the link from above, I received the ‘operator not supported for strings’ error. It seemed that the l() function that at default tried to set the class attribute ‘active’, was causing the error. By removing the parameter for setting the class attribute, the problem got solved. My link now looks like:
l(‘some url text’, ‘the-path-for-the-current-active-page’)
This doesn’t cause any errors anymore.