r/programming • • Jan 05 '11

Drupal 7 released.

http://drupal.org/drupal-7.0
222 Upvotes

259 comments sorted by

View all comments

Show parent comments

7

u/UnConeD Jan 06 '11 edited Jan 06 '11

That is pretty much a given. In fact, CCK is even part of core in D7. Commenting on Drupal sans-CCK/Views is sort of like commenting on a car without its tires (bad analogy, I know).

CCK is only good if the UI provided by CCK suffices. If it doesn't, then the added hassle of having to deal with procedurally generated objects, types and tables quickly becomes a nightmare. I've found it much, much easier to just write a simple ORM mapper and do the rest myself, and not for lack of trying either.

It's not just me who goes without it: the Ægir hostmaster system that stores all its data in node types also chooses not to use CCK. Go look at the people who made that and tell me they don't know Drupal.

Incidentally, you're talking to UID 10 on Drupal.org. Long story.

The first part is vague and the second part screams for benchmarks.

You must be unaware of the layers of indirection that are taking place here. Also, views is terrible on the inside. It's a nightmare of handlers, plug-ins and uncaught errors waiting to happen. There's also the fact that using Views requires you to structure your code very differently and in a remarkably un-drupal-like way. For example, you cannot ship views templates inside an associated module's directory (unlike regular templates), they have to go in a theme. Unless you implement hook_theme_registry_alter() to undo it, yay.

Other people apparently feel the same.

My latest Views project was trying to hook up an external data source to Views 3. It's absolutely terrible and that's with example code to model it off (apachesolr).

Is this really so different than every other system? WP requires themers know PHP to do anything useful in a theme. ExpressionEngine uses its templating system which is basically just a different looking version of PHP. I'd be interested to see what you think is so different about Drupal here.

How do I get rid of the colon after form field labels? The answer is not to tweak a template of HTML-with-sprinkles but to dive into hardcore PHP code. Shall we mention theme('table')? Or perhaps the $node->content array of doom?

Not really sure what you mean here, but if you're just saying that it's difficult to customize the node's output, then you might checkout the contemplate or display suite modules.

Actually I meant the node editing form. It's the most basic part of a CMS, and Drupal sucks at it. Vertical tabs or not, the idea that everyone should edit all sorts of content through the exact same UI is madness. It also ignores the fact that you don't create an end-user oriented UI by hiding parts of the developer-oriented UI and calling it a day.

What's the difference? You can turn things off with alter hooks. What's an example of a system that has a preferable behavior here in regards to overriding core behavior?

The proper answer is to use inheritance to override behaviour rather than to undo it, e.g. using MVC to separate concerns and OO to allow for selective code modification.

Go and try to make it so that people can log-in with their e-mail address instead of their username. I'll wait while you figure out how to get rid of the error messages that no longer make sense.

Or perhaps you would like to replace the godawful password recovery page with one that actually looks like something a real web service might use? Unfortunately, the code that verifies the security hash is intricately tied with the part that displays the UI so your only option is to menu_alter out the entire page and reimplement it.

This is just an opinion. I've never had much trouble with FAPI.

Have you ever defined a custom element type? Used #after_build or #process functions? Used #ahah/#ajax? And done so without ever encountering a random type error deep inside form.inc? The menu system suffers from the same affliction: if you accidentally forget the array() around the 'access arguments' for example, you'll end up with some cryptic error deep inside menu.inc. The only way to debug these errors is to insert trapping code at the reported location, which incidentally is a whole cache refresh and page request later than the offending bug.

Fact is, Form API is undocumented and untested for the things it was supposedly designed to do. Do you know the rules around form caching and $form_state['storage']? When $form['#cache'] is needed? Or that your form element IDs will get broken if you trigger a form rebuild inside a page request? Yay. Still broken as far as I know.

Same as above; I've never had trouble with node_load() and node_save().

Detailed here: http://www.reddit.com/r/programming/comments/ewoub/drupal_7_released/c1bl1cl

This sounds like a nitpick to me. Does this really affect your programming or make any difference in your day to day work? Or does it just bother you on principle?

Have you looked at the signature for user_save()? You cannot simultaneously modify two properties that are situated on different user profile tabs. By design. If you do any work with hook_user(), this will bite you in the ass. User objects are also unique in Drupal in that they will store custom properties for free. Incidentally, this has lead to many contrib modules polluting the users table because they don't expect it. Like the legal.module, which pushed the entire terms of service into every single row in the table.

I'd be interested in more details here too. For example, it's fairly common to grab the uid from global $user, and I've never really hard any complaints about global $user before now.

Passing the global $user object into user_save() will result in data loss if you have any modules that extend the user object. Simple as that.

Certain things like what? I only have a small amount of experience with install profiles, so this is a curiosity question.

Just one example. There are many, because of how much of a clusterfuck install.inc is. It tricks Drupal into thinking it's already installed to bootstrap it, and then pretends nothing's wrong when it installs all your modules and themes (which then fails when they do anything complicated on install).

You're supposed to take advantage of contrib modules, that's sort of the beauty of Drupal.

Except for the part where they are insecure and have terrible usability. Like for example the Single Sign-On module, an authentication module that let you steal UID 1 access from an admin with a single click. Or the Services module, where an elaborate fix for a reported security issue was itself insecure and spoofable. If you look at the security reports for Contrib, you find that they are the same vulnerabilities over and over again, in different modules, over several years. People are not writing better modules.

I have yet to encounter a situation where I can actually drop in a contrib module and have it satisfy my professional requirements. It just doesn't happen. I have to review their security, fix the interaction flow, get a designer to make it actually nice... and that's assuming there isn't some DB-server-destroying query in there.

If I have to audit every single contrib module I want to use, and the reward is a module that's kinda crappy anyway, I'll pass. It's just not worth it.

2

u/CritterM72800 Jan 06 '11 edited Jan 06 '11

Incidentally, you're talking to UID 10 on Drupal.org. Long story.

Yeah, sorry about that. Right after I posted, I realized it was you. I wouldn't have dumbed it down if I had. Anyways, thanks for the replies.

1

u/vertice Jan 06 '11

I get your point, but Ægir is nothing like your typical Drupal site, and the typical best practices don't and shouldn't apply to that specific of an implementation.

Our reasons were maintainability, deployability and dependability.

I actually wouldnt recommend the use of CCK for anything other than prototyping, because it becomes nigh on impossible to provide a reliable upgrade path, even if you follow best practices

And no, i'm not fond of fields in d7 either.

2

u/davereid20 Jan 06 '11

"How do I get rid of the colon after form field labels?"

Gone by default in D7.

1

u/CritterM72800 Jan 06 '11

Short on time, but just a few quick responses.

Ægir hostmaster system that stores all its data in node types also chooses not to use CCK. Go look at the people who made that and tell me they don't know Drupal.

I get your point, but Ægir is nothing like your typical Drupal site, and the typical best practices don't and shouldn't apply to that specific of an implementation.

How do I get rid of the colon after form field labels? The answer is not to tweak a template of HTML-with-sprinkles but to dive into hardcore PHP code. Shall we mention theme('table')? Or perhaps the $node->content array of doom?

You're picking out the bad parts and ignoring the good parts. Every system has seemingly simple things that end up being complicated, Drupal is no different.

the idea that everyone should edit all sorts of content through the exact same UI is madness.

It may be, but it's the standard. WP, Django, ExpressionEngine, Joomla, all have a one-size-fits-all content-editing UI.

Or perhaps you would like to replace the godawful password recovery page with one that actually looks like something a real web service might use?

Why can't this be done by theming/blocks/whatever? What exactly would you want to do to that page that isn't easy?

Except for the part where they are insecure and have terrible usability.

This is a risk you take when you use community code. Again, it's no different in WP plugins, EE modules/extensions, etc. In fact, I've found the quality in Drupal to be above par.

I have yet to encounter a situation where I can actually drop in a contrib module and have it satisfy my professional requirements.

If that's true (never? really? not even the tiny do-almost-nothing modules?) then your standards are irregularly high, and hundreds of thousands of sites have been built by devs who used contrib modules and didn't feel the same, yet had no major issues.

0

u/ritontor Jan 06 '11

Drupal's security record is a trillion times better than Joomla's, and I am only barely speaking in hyperbole when I say that.

1

u/Ergomane Jan 06 '11

Apart from a few exceptions, Drupal's contrib is a cesspit of insecure, buggy modules and themes.

1

u/ritontor Jan 07 '11

You obviously haven't ever seen Joomla's module repository then. In general, Drupal modules are fairly well written, as they use the tools provided by core to write reasonably secure code.

1

u/Ergomane Jan 07 '11

Considering your claims, you might not have seen Drupals module repository then.

I did not make the statement to compare Joomla and Drupal modules.

as they use the tools provided by core to write reasonably secure code.

Except they do not. Authors don't know or care about them. Most modules have more security vulnerabilities than users.

placeholders, whut?? Let's build an nice IN() SQL clause with implode...

and then you've gems like the one below from the criminally clueless:

$output = html_entity_decode(check_plain($foo));