Comments

pfaocle’s picture

Anyone have any thoughts on including the new AJAXy drag n' drop weights that Drupal 6 has?

pfaocle’s picture

FYI, minor .info file changes and DB schema stuff for .install is already committed to HEAD.

pfaocle’s picture

Status: Active » Needs work
StatusFileSize
new3.67 KB

Attached is a starting point - most of the items from updating modules from 5.x -> 6.x are covered, I think. Current HEAD with this patch is semi-functional with 6.0, the most obvious issue being that altering the user_admin_new_role form to allow for editing the two default, locked roles isn't working.

pfaocle’s picture

StatusFileSize
new3.88 KB

Now includes redirecting with $form_state.

liliplanet’s picture

Looking so forward to the release of role weight for Drupal 6.x. Used it extensively in 5.x

Thank you!

fuzzy_texan’s picture

Subscribing

rgraves’s picture

Any ideas when a Drupal 6 version will be ready for production?

manoloka’s picture

subscribing

pfaocle’s picture

StatusFileSize
new3.6 KB

Patch about to be committed to HEAD. No solution to editing Drupal's locked roles yet, however.

pfaocle’s picture

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

Attached patch brings HEAD in line feature-wise with 5.x-1.3, including editing locked roles and re-ordering admin forms.

I've stripped out Views hooks for D5/Views 1 - this will need completely re-writing and has its own issue: #419846: Improve Views support

pfaocle’s picture

Status: Needs review » Fixed

Applied #10 to HEAD: http://drupal.org/cvs?commit=191306

Anyone willing/able to test from HEAD before I branch for 6.x?

Status: Fixed » Closed (fixed)

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

liliplanet’s picture

Status: Closed (fixed) » Active

Sorry, have to re-open issue. Been patiently waiting for months for the version 6.x, will this possibly be happening?

Just need Role Weights to sort in Views.

Thank you for any updates :)

pfaocle’s picture

Role Weights HEAD version should be compatible and working with 6.x. I'm super-hectic atm, but will try to branch asap so people can test a 6.x-1.x-dev version.

Unfortunately, Views 2 (D6) support is fairly complex and I have limited time so I have stripped out Views 1 (D5) support for now. Please see #419846: Improve Views support for further info - any help on this greatly appreciated.

luti’s picture

StatusFileSize
new3.37 KB

I've downloaded and tested HEAD (a link in post #11) which, by the way, doesn't match the packed HEAD version.

Everything seems to work well on my system, so consider it as tested regarding me.

I believe a 6.x development version would contribute significantly to users interest (I also didn't notice those latest changes, as module was not even on my "Available Updates" list, so I have more or less forgotten that it even exists in my system...). It would also help us all to test and discuss about the same version, as now it is not so eays to get this latest release (also the link doesn't lead directly to files, but I've had to follow some links before finding the useful files listed...). So, I would suggest to put together and publish at least the 6.x-0.x-dev version ASAP.

I also think the setting in a general configuration file is not comfortable at all, not to mention that it can probably lead to more serious troubles (if someone manages to make settings file unreadable to Drupal). So, I've made some small changes to set the variable through an admin screen (as practically all other moduleas are doing it...) - this way, whatever you choose there, you shall not break anything... Furthermore, I've created a help screen (putting there more or less the useful content of the README file provided).

My contribution doesn't change the basic functionality in any aspect, it just makes the usage of this module a bit more comfortable (and maybe safe). As I am not a skilled coder, it would definitely be good that someone more experienced checks the code (it seems to work just fine on my system though). My code is in the attachment.

As a final touch, I would suggest to consider some (I believe just minor) twists to satisfy the Coder module, which currently throws out the following errors and warnings:

role_weights.module:

Line 82: Use "elseif" in place of "else if"
        else if ($form_id == 'user_admin_role') {

Line 129: Use "elseif" in place of "else if"
        else if ($form_id == 'user_admin_perm' && variable_get('role_weights_reorder_forms', FALSE)) {

Line 136: Use an indent of 2 spaces, with no tabs
            }	

(!!!) Line 178: The parameters for form validation and submission functions have changed to $form, &$form_state.
      function role_weights_admin_role_submit($form_id, &$form_state) {

(!!!) Line 205: SQL query handling data in a potentially insecure way by using the %%s placeholder without wrapping it in single quotes. This is a potential source of SQL injection attacks when the value can come from user data.
              db_query('DELETE FROM {users_roles} WHERE rid = %d AND uid IN (%s)', $id, implode(', ', $uid));

---

role_weights.install:

Line -1: @file block missing (Drupal Docs)

Line 2: Include the CVS keyword $Id$ in each file. This should be in the format // $Id$ or // $Id$
        //$Id$

At least those 2 critical warnings, marked as (!!!) don't look nice at all (it may be also the Coder issue, but still - I just like it when Coder is not complaining...).

pfaocle’s picture

Status: Active » Fixed

Thanks for your input! I have corrected some coding style as per Coder's recommendations, and the SQL insecurity is no longer an issue on supported branches (5.x-1.4, 6.x). I have also branched for 6.x, so there's a 6.x-dev version to use and test.

In order to mark this issue closed, I've added #485150: Add help and settings pages which I'll look at soon. Thanks again.

Status: Fixed » Closed (fixed)

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