Hi,
I'm potentially interested in using section module with Drupal 5.x .
Are you going to prepare such a version soon? And probably the most important question, are you going to keep developing this module or is it a 'finished' project?

Thanks,
Zibi

Comments

Permanently Undecided’s picture

subscribing

Bèr Kessels’s picture

There will not be a 5 release, unless someone produces a good patch. I am not using it on 5 myself.

Permanently Undecided’s picture

May I ask if you're not using it anymore because you have no more need of it, or because Drupal 5 introduced something I'm not aware of, that made this module unnecessary?
So far the sites I've ported to 5 don't need this, but there's another site I need to upgrade that just can't exist without this module, so I'll try and update this myself if it's just lack of necessity/time/interest that is preventing the update.

Bèr Kessels’s picture

I just don't develop or run any 5.x sites yet.

Marc Bijl’s picture

I used sections module too. Because there's no version for 5.x I decided to create the needed functionality myself. I created a few contenttypes, e.g. "thing", "calendar", "list", et cetera (can be anything). Based upon these definitions, it's possible to assign different page templates to different content types. My page.tpl.php looks like this:

<?php

/**
 *	This snippet loads up different page-type.tpl.php layout
 *	files automatically. For use in a page.tpl.php file.
 *
 *	This works with Drupal 4.5, Drupal 4.6, Drupal 4.7 and Drupal 5.x
 */


if ((($_GET['q']) == variable_get('site_frontpage','node')) || ($node->type == 'thing') || ($node->type == 'calendar')) {
	include 'page-image.tpl.php'; /* TEMPLATE MET BREDE KOLOM / WIDECOLUMN */
  return; 
}

if ((($_GET['q']) == 'node') || ($node->type == 'page') || ($node->type == 'blog') || ($node->type == 'list') || ($node->type == 'webform')) {
	include 'page-text.tpl.php'; /* TEMPLATE MET SMALLE KOLOM / SMALLCOLUMN */
	return;
}
		
/**
 *	if none of the above applies, load the page-text.tpl.php (kind of default)
 */

include 'page-text.tpl.php'; /* TEMPLATE MET SMALLE KOLOM / SMALLCOLUMN */
return;

?>

I've created two additional templates (page-text.tpl.php and page-image.tpl.php) which are applied depending on the content type.

Works like a charm for me :)

Permanently Undecided’s picture

Title: version for Drupal5 ? » Update for Drupal 5
Assigned: Unassigned » Permanently Undecided
Category: feature » task
Status: Active » Needs review
StatusFileSize
new8.09 KB

Here's a patch...

Permanently Undecided’s picture

StatusFileSize
new137 bytes

...and here's the .info file (I had to add a .patch to it or I couldn't attach it. Remove it for it to work properly.)

Bèr Kessels’s picture

Status: Needs review » Needs work

You have messed the identation a little, see e.G. the settings_form

Also please don't add new features. remove e.g. drupal_set_message(t('The section %name has been added.', array('%name' => $edit['name']))); We should leave features for later, lets not clutter the upgrade to 5 by slipping in new features that need testing etc. etc.

The permission 'adminster sections' is a bug. But let us not cluutter the upgrade with fixing bugs and typos. Please try to keep the patches as small as possible. Same goes for the cleanup in menu you did. Lets leave cleaning for a later patch.

If you get rid of all the (appreciated!) extra work, this patch is smaller then 15 lines or so, making it very easy to review and commit.

Permanently Undecided’s picture

Status: Needs work » Needs review
StatusFileSize
new5.97 KB

Here's a reroll.

hass’s picture

remove

version = "$Name$"

from .info file. this will be added by drupal packaging system.

hass’s picture

isn't it better to put sections config inside "Site building"? There is node_style and some other site building configs placed.

Permanently Undecided’s picture

StatusFileSize
new117 bytes

Here's the corrected .info file. As for the other point you raised, hass, I agree with you, but that'd be a change from the 4.7 version, where it's under admin/settings, and Bèr prefers to keep the update free from changes and then later add fixes/improvements/etc.

Do I need to fix something else or is this patch RTBC?

hass’s picture

Category: task » feature

corrected "Category"

inforeto’s picture

subscribing

inforeto’s picture

Testing the patch on two sites.
The first was a fresh install which worked just fine.

On the second, sections was already installed on a 4.7 site, and removed during the upgrade to 5.x
It had to be reinstalled for the link to work on 5.1
Then update.php throwed duplicate errors on the new columns.
Data was already on the existing table from the 4.7 install.

hass’s picture

Status: Needs review » Needs work

there is a bug inside

<h1 class="title">Edit &lt;em&gt;Frontpage&lt;/em&gt;</h1>

where <em></em> get visible to a user on the edit section page.

hass’s picture

Additional the title of "admin/settings/sections/add" should be "Add section" and not only "Section"! Very bad for translation...

hass’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new12.7 KB

i worked with the provided patches and fixed all minor open bugs, fixed tons of coding style bugs and made it Drupal 5 conform (path is now admin/build/sections). The patch contains all this updates, corrections and the missing .info file and apply to today HEAD version. Additional the patch includes a small translation fix in the Edit form and i have already committed the current POT file build from this code together with a 100% complete German translation.

Now release, please. So we are able to check the module status with "update_status" module...

Bèr Kessels’s picture

Status: Reviewed & tested by the community » Needs review

It needs some testers first. I don't have a 5.x site available to test.

hass’s picture

on my testbox it works like a charm, for sure.

Taz’s picture

I will be testing this out on two different drupal 5 sites, will let you know how it goes. You should just go ahead and make a drupal 5-dev release. Let me know if you're interested in having another maintainer onboard.

hass’s picture

StatusFileSize
new13.57 KB

Here is an update that removes the default "Admin" section from install section and removes MyISAM from DB to use the DB default engine. Removing the Admin sections makes big sense, while this feature has been implemented out of the box in drupal core

hass’s picture

StatusFileSize
new14.33 KB

i've done a more detailed review of the HEAD code and found some small SQL bugs and a typo in "adminster". The typo has been corrected now and the string is now enclosed in single quotes. So this one should be nearly perfekt one.

hass’s picture

i missed to say a minor translation bug has been fixed, too. i will commit the updated POT files asap.

Bèr Kessels’s picture

Status: Needs review » Needs work

I'd hate to be spoil the party, but you are breaking the #1 rule or patching: keep em small and selfcontained. As the patch is now, it contains some minor things that I don't like, but in overall I like the changes.
But please, keep them selfcontained. I understand your urge to fix typos, whitspace fixes and so forth while 'you're at it', but right now these changes are only cluttering the real issue at hand: getting a 5.x release out.

Can you not isolate the parts that make it a 5.x release? After that, we can have a look at the cosmetics such as double-quotes, whitespace etc.

Bèr

hass’s picture

I'm sorry, for mixing some things. It's much easier to compare my well working version with HEAD (Eclipse does all this for me with some clicks) and not going to spending days in splitting everything in small patches after a big workout.

Therefor i put all inside, what required and should to be fixed. I don't know why i should remove or turn back things that will be fixed later. This patch is working like a charm, i use it and deliver it inside an drupal installer profile.

It looks like you don't spend much time on this module and therefor it should be as much committed - as possible, while we all must wait months for a release - why ever. i don't understand what you are waiting for! i hate to create a download page for sections outside drupal.

inforeto’s picture

Thanks for all your work!

I'll review the code too, and it'd help to have the two patches separately.
I agree it is a requirement to make release versions possible.

Taz’s picture

I beg to differ. Many people between a drupal 4.7 and 5.0 release do a fair bit of code cleanup. Sometimes even new features. He hasn't even enhanced much, but rather tidied bits up. Something i know i do automatically when i re-code or update something, is to make it cleaner - more efficient and more standardised.

If you just released a 5.1-dev already then these giant patches wouldn't be needed, and a patch base could be referred to on the 5.1 level, rather than all the changes. The patch is only really big because of the forms API changes that were made between 4.7 and 5.0 and where administration items are located in terms of path structure.

hass’s picture

i know i made this patch not as small as possibly, but all this have been done, while we need a FINAL and not to wait another year of dev versions. I asked in October or September about a 4.7.x - until now - nothing happen.

Therefor all bugs regarding drupal coding rules are fixed too. i don't see the problem with this. This patch gives the ability go go forward on a very good code basis and code style. We shouldn't release something unready and we shouldn't have another year of DEV's.

1. The translation fixes must be in place to get this into a sensefull and good looking final. It's not helpfull to release a German translation and some strings are not translated.
2. a typo in permissions names is difficult to fix later in a second release, so it should be fixed before a release or the next release may drop the perms an admin have done.
3. Drupal coding style bugs should be fixed whenever found - no harm - but readable code is much better.
4. SQL bugs: if we insert a string, this one must be enclosed in single quotes - if not - it may fail. Its bad behavior to let this waiting until a user will find it.
5. update_status requires a *release*. update_status cannot compare dev or CVS versions. a release won't harm anything.

befor applying this patch, create a 4.7-dev branch with current HEAD. no matter if you don't like to release a 4.7.x. i'm using head version on a 4.7.x in production for over 7 months without any problems.

hass’s picture

StatusFileSize
new14.56 KB

This one additional fixes a usability bug - i'd like to name this "default radio value not set" on "Add" new section.

Fix:

'#default_value' => $edit['visibility'] ? $edit['visibility'] : 0
hass’s picture

StatusFileSize
new14.59 KB

tabs ordered correctly now.

Bèr Kessels’s picture

Status: Needs work » Needs review

please review and test the latest patch, someone.

hass’s picture

I've got a cache problem, but i cannot figure out what's wrong. I've configured a subtheme for , but if "normal" cache mode is active and i'm an anonymous user the custom theme do not get loaded. if cache is turned off, the problem goes away for anonymous users.

Any idea?

hass’s picture

...subtheme for <front>

hass’s picture

StatusFileSize
new16.15 KB

ok, i think the cache issue is now fixed. however i was unable to figure out why this problem only exist in cached mode. the trace module is buggy and crashed my dev site in cached mode and devel module helped not so much, too. I reviewed some other modules using $custom_theme (taxonomy_theme, themeswitcher, node_style and referer_theme) and haven't found much difference.

Finally i changed the module weight in system table to "-10" and all problems are gone. This should additional solve some incompatibilities with other modules like node_style. The missing uninstall routine is now added to the sections.install file, too.

If you cannot patch yourself, download here: http://www.yaml-fuer-drupal.de/de/download#sections

Try out and give some feedback, please.

jessZ’s picture

I installed this on 5.1quicky install by fantastico and set chameleon and pushbutton themes
seems to work fine.

in the module list the $name$ appears instead of the version number.

"Sections $Name: $ Allows you to define sections of your site and apply themes to those sections"

I'll be testing it next on a fuller sandbox installation with custom themes and more complex block settings headers and other variables. I'm happy to see this as a 5.1 since i am in the process of upgrading a large 4.6 production site that uses this feature.

hass’s picture

The version number will be placed inside the package by drupal build system. So until we don't have a build made by the packaging system, the version is not displayed... therefor no bug :-).

hass’s picture

Assigned: Permanently Undecided »
StatusFileSize
new17.97 KB

Here is an updated patch. This one fixes some code style issues, older bugs in the SQL requests with %d and finally fixes the caching issue what was of the main bug in the previous patches.

I'm ready and i don't know about any issues with this patch and i'd learned to never ever use theme_placeholder in a menu item!!! This is the bug that broke the theme switch while caching. See the bug report in http://drupal.org/node/142791 for more info.

hass’s picture

StatusFileSize
new18.51 KB

re-rolled to include missing .info file

hass’s picture

Status: Needs review » Fixed

5.x branch as been created in CVS and patch has been committed.

hass’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev
Anonymous’s picture

Status: Fixed » Closed (fixed)