due to drupal 6.2 API changes drupal will throw 'access denied' (403) when user tries to edit or create filters. this also applies for UID1 !!!
To fix this flexifilter_menu() function needs to be updated to include 'access arguments' => array('administer flexifilter') for every menu array item returned. implementation of hook_perm is also needed:

function flexifilter_perm() {
  return array('administer flexifilter');
}
CommentFileSizeAuthor
#31 flexifilter_access_arguments.patch2.98 KBmarcvangend

Comments

scor’s picture

Status: Active » Postponed (maintainer needs more info)

this should have been fixed in the dev version. Are you sure you are using the latest dev version and that you ran update.php?

scor’s picture

Status: Postponed (maintainer needs more info) » Active
rovo’s picture

I'm using 6.2 and the latest dev version, ran update.php; and still get the access denied message. Is there something else I should do? I'm not sure where to implement the above mentioned code. Thanks

siliconmind’s picture

just edit flexifilter.module file and replace flexifilter_menu() function with this code:

/**
 * Implementation of hook_menu()
 */
function flexifilter_menu() {
  $items = array();
  $items['admin/build/flexifilters'] = array(
    'title' => t('Flexifilters'),
    'description' => t('Create new flexible input filters without writing any code.'),
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_list_form'),
    'file' => 'flexifilter.admin.inc',
  );
  $items['admin/build/flexifilters/list'] = array(
    'title' => t('List'),
    'access arguments' => array('administer flexifilter'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/build/flexifilters/add'] = array(
    'title' => t('Add new flexifilter'),
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_edit_form'),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
    'file' => 'flexifilter.admin.inc',
  );
  $items['admin/build/flexifilters/import'] = array(
    'title' => t('Import a flexifilter'),
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_input_form'),
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
    'file' => 'flexifilter.admin.inc',
  );
  $items['admin/build/flexifilters/defaults'] = array(
    'title' => t('Load a default flexifilter'),
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_default_form'),
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
    'file' => 'flexifilter.admin.inc',
  );
  $items['admin/build/flexifilters/%flexifilter'] = array(
    'title callback' => 'flexifilter_get_field',
    'title arguments' => array(3, 'label'),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_edit_form', 3),
    'file' => 'flexifilter.admin.inc',
  );
  $items['admin/build/flexifilters/%flexifilter/edit'] = array(
    'access arguments' => array('administer flexifilter'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'title' => t('Edit'),
  );
  $items['admin/build/flexifilters/%flexifilter/export'] = array(
    'title' => t('Export'),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_export_form', 3),
    'file' => 'flexifilter.admin.inc',
  );
  $items['admin/build/flexifilters/%flexifilter/preview'] = array(
    'title' => t('Preview'),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_preview_form', 3),
    'file' => 'flexifilter.admin.inc',
  );
  $items['admin/build/flexifilters/%flexifilter/delete'] = array(
    'title' => t('Delete'),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_delete_form', 3),
    'file' => 'flexifilter.admin.inc',
  );
  $items['admin/build/flexifilters/%flexifilter/enable'] = array(
    'title' => t('Enable'),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_enable_form', 3),
    'file' => 'flexifilter.admin.inc',
  );
  $items['admin/build/flexifilters/%flexifilter/disable'] = array(
    'title' => t('Disable'),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'access arguments' => array('administer flexifilter'),
    'page arguments' => array('flexifilter_filter_disable_form', 3),
    'file' => 'flexifilter.admin.inc',
  );
  return $items;
}

don't forget to add this:

/**
 * Implementation of hook_perm().
 */
function flexifilter_perm() {
  return array('administer flexifilter');
}
siliconmind’s picture

scor, i am sure :)
just checked filedates.
flexifilter.info is dated April 15th so i'm pretty sure it's one of the latest. but flexifilter.module - the one that implements hook_menu() is dated way back to Feb 29th :/

cwgordon7’s picture

Yes all this stuff is already fixed in HEAD, I'm experiencing CVS difficulties, grr...

rovo’s picture

The above code worked for me, thanks.

cwgordon7’s picture

Status: Active » Fixed

I have fixed several CVS issues, the code already in HEAD should now be available in the dev release.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

sibidiba’s picture

Status: Closed (fixed) » Active

Still not in the release version.

Mentioned patch seems functional, but new error message appears if I edit a filter, and click on preview:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'flexifilter_filter_preview_form' was given in /home/czigola/public_html/online/includes/form.inc on line 358.

cwgordon7’s picture

Title: drupal 6.2 throws 'access denied' (403) when user tries to edit or create filters. » Create a 6.x-1.1 release

..yeah. When it's stable enough.

wayland76’s picture

Can I recommend creating a flexifilter 6.x-1.1-rc1 or even a flexifilter 6.x-1.1-alpha1? And setting it so that it appears on the front page?

Flying Drupalist’s picture

Is the dev version as unstable as warned? I'm looking forward to a fix of this issue.

arhak’s picture

subscribing

icouto’s picture

Version: 6.x-1.x-dev » 6.x-1.1-rc1

Please note, that the current rc1 version is from January '08, and still throws the error mentioned. Should perhaps the 1.1-dev version be listed in the front page, as a '1.1-rc2'? The currently listed rc1 - which is 'recommended' for D6 - is actually unusable with the latest D6.4, because of this error...

Many thanks in advance! :-)

chasz’s picture

+1

Antinoo’s picture

+1

arhak’s picture

+1

Roi Danton’s picture

Priority: Normal » Critical

Code of post #4 (http://drupal.org/node/247416#comment-811270) works. It is necessary that the current rc version gets this update. Marked as critical because the current version isn't usable without modification.

avpaderno’s picture

Title: Create a 6.x-1.1 release » Access denied for UID 1
cwgordon7’s picture

Title: Access denied for UID 1 » Create a 6.x-1.1 release

This weekend. I promise. Now stop messing with the issue queue, please.

avpaderno’s picture

Title: Create a 6.x-1.1 release » Access denied for UID 1

I am not messing the issue queue; I simply changed the issue title to something more significant.
Create a 6.x-1.1 release could be a title for a feature request, not a bug report; as the issue described here is exactly the access denied problem caused by an incomplete implementation of hook_menu(), I titled the issue Access denied for UID 1.

Giving to the issue report a wrong name will cause other people to report the access denied issue again, and again simply because they will not see any issue which reports about that.

Description

due to drupal 6.2 API changes drupal will throw 'access denied' (403) when user tries to edit or create filters. this also applies for UID1 !!!

cwgordon7’s picture

Title: Access denied for UID 1 » Create a 6.x-1.1 release

Create a 6.x-1.1 release could be a title for a feature request, not a bug report

But its category is set as "bug report". That seems pretty self-explanatory to me.

Giving to the issue report a wrong name

This is actually not the wrong title, believe it or not. There were multiple issues with the present release, that eithere were already fixed or still need to be fixed in the dev version and an updated release needs to be published for them, too. Renaming this issue to the specific bug you encountered does not help me in my organization here; the more organized I am, the faster bugs get fixed, the faster the new release gets out there. I promised a release for this weekend, and I intend to live up to my word. But please, leave the issue title reflective of the actual issue here. The issue is not that I have to solve the access denied for uid 1 stuff; it's that I need to reverse several bad cvs commits to the wrong branch and re-commit them to the right branch and tag everything properly.

avpaderno’s picture

An issue title is not thought to be used by the maintainer to organize better the work to do on a project.
The title helps who wants to report an issue he found with a module, without to write an issue report for an already reported issue; or it can be used by who can be interested in the use of the module, and wants to check first if there are any problems using the module.

The title doesn't reflect the actual issue which is the access denied problem that happens with the last releases of Drupal 6.

It seems that the intent is to hide that there is such a problem with the module; there was another issue titled Access denied for UID 1 but first it has been reported like fixed (which is not true), and then reported like duplicated.

arhak’s picture

+1 for Kiam, it makes a lot of sense, since a new release should be issued as a "task" which is different for the issue to be followed (whether it's fixed or not)

avpaderno’s picture

Component: Code - API » Code - Misc

I think that the next release could rather difficulty be called 6.x-1.1.
It would be better to fix the problem introduced with Drupal 6.2, and release a 6.x-1.1-rc2; only after that, a version 6.x-1.1 can be planned.

justindavis’s picture

Is there an estimated date planned for this next bug-fix release? I can't find any recent commits in the CVS repository.

cwgordon7’s picture

Status: Active » Fixed

Committing a few other patches and then releasing a new release candidate (not at 6.x-1.1 yet, sorry).

Status: Fixed » Closed (fixed)

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

Michali’s picture

Title: Create a 6.x-1.1 release » Missing options and Access Denied error when editing filters
Version: 6.x-1.1-rc1 » 6.x-1.1
Status: Closed (fixed) » Active

This is an issue again. I'm trying to make Flexifilter (version 1.1) work with Drupal 6.15, and got the Access Denied error. The solution described here fixed it.

marcvangend’s picture

StatusFileSize
new2.98 KB

This is an annoying bug. I don't quite understand why there still isn't a proper version released. Here is a patch against 6.x-1.1.

cwgordon7’s picture

My understanding is that this isn't a problem on the development branch. If someone can confirm that development branch works for them, I'd be happy to create a new official release for it.

Roi Danton’s picture

The 6-1 branch contains the fixes, however
1) There is no release for 6-1 branch at do.
2) When browsing the CVS repository one has to know that 6-1 is the newest and not 6-2, Main or Head. For most users this will be confusing.

So create a release for the 6-1 branch or create a 6-1.2 tag of the 6-1 branch, please.

TripleEmcoder’s picture

Subscribing and confirming patch from #31 works.

larowlan’s picture

I can confirm the DRUPAL-6--1 branch works fine when checked out from CVS but the release on the project page does not.

Frank Leith’s picture

I waited for some month's now but the version on the project page is still broken. Reading the last updates I understand that development version is working fine. Can someone explain to me how I can download that version?

Roi Danton’s picture

Frank Leith’s picture

I don't get a working version using the development versions or the patch. Maybe I am doing something wrong. Can anybody put a full working module somewhere online. This project seems to be without a maintainer.

ianchan’s picture

subscribe

cwgordon7’s picture

Version: 6.x-1.1 » 6.x-1.2
Status: Active » Fixed

This has been fixed for a while on the development release. In addition, this is fixed in the latest release.

Status: Fixed » Closed (fixed)

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