Patch attached


hass’s picture

759 bytes

d.o form preview bug

mikeytown2’s picture

Status: Needs review » Fixed

committed to 7.x

mikeytown2’s picture

This patch has been applied to 6.x & 7.x

hass’s picture

Why are you cluttering the code with useless version stuff? This is very bad practice.

mikeytown2’s picture

Drush does this as well. Keeps my code the same as there are only a couple of small differences between 6.x and 7.x. Having 6.x and 7.x interchangeable for the most part makes my life a lot easier.

hass’s picture

In Drupal we break with backward compatibility with every major release. This is done for code cleanup and many other reasons. I understand your reasons, but it's bad practice... Never seen it anywhere... Doing substr in many places costs time and is fairly useless, as it's D7 and we do not need to maintain backwards compatibility. We are only looking forward and D6 may no longer maintained aka receive no new features soon... :-)

mikeytown2’s picture does this. The concepts behind HTTRPL are fairly low level, the code *could* stand on its own as it only uses a couple of things from Drupal. It is not your typical Drupal Module. The places where the code differs between 6.x and 7.x are only in a couple of places; and only because it is using Drupal API Calls.

As for performance I did a Xdebug/CacheGrind of one of my sites and it takes a total of 0.2ms to run substr() 1,511 times. In short I'm not worried about performance when using this coding pattern.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.