Hi,

I am trying to use colorbox to display forms on my site.

I have a test link :
Create new account

and I have selected: "Enable Colorbox load" in the colorbox settings.

When I click on the link after a few seconds I get the following message:
"Request unsuccessful: Forbidden message" inside the colorbox.

Why would that be?

Comments

xamanu’s picture

Version: 6.x-1.0-beta7 » 6.x-1.x-dev

Are you logged in? This form wouldn't be available for you.

But I can confirm this when using custom forms, defined outside from core. Is there a good way to debug this?

xamanu’s picture

Status: Active » Needs review
StatusFileSize
new2.31 KB

The module checks just for some specific forms:

[...]
case 'contact_mail_page':
// checks specific permission
case 'user_register':
// checks specific permission
case 'user_pass':
// checks specific permission
case 'user_login':
// checks specific permission
case 'user_login_block':
// checks specific permission
case 'user_login_block':
// checks specific permission
default:
// All other forms get no access.
$access = FALSE;
[...]

This is not really extensible. Wouldn't it make sense to pack an array like array($form_id => $access_callback) and use a drupal_alter() before checking all stuff? This would at least allow other modules to provide more form to load for colorbox.

I attached a little patch for that. Please review.

leilyrken’s picture

I need exactly that.

frjo’s picture

A hook_colorbox_form_access is already implemented.

Do you think I should change it to a drupal_alter()? It looks a bit nicer code wise.

charlie-s’s picture

I am logged in as admin (uid=1) and receive this error when attempting to link to an Ubercart add-to-cart form.

Edit: Upon reading #2 I see that this module only allows you to link to a handful of core forms. The patched method sounds more appropriate.

stred’s picture

yes it's not really obvious to know that the module implement his own form_access... permissions are already defined in the form so for custom forms it looks like doing the job twice !

great module anyway

jwilde’s picture

This problem still exist in drupal 7.

ParisLiakos’s picture

Status: Needs review » Fixed

There is handy hook..just use this to enable acces

/**
 * Implements hook_colorbox_form_access.
 */
function MYMODULE_colorbox_form_access($form_id) {
  $access = FALSE;

  if ($form_id == 'my_module_form') {
    $access = TRUE;//or use user_access()
  }

  return $access;
}

Status: Fixed » Closed (fixed)

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

prodigeek’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Category: support » bug
Status: Closed (fixed) » Active

I'm still getting this message, testing on the full and dev versions. I've even tried using the hook and the patch (and cleared my cache) but I'm still getting this error. The register link also gets the error: Request unsuccessful: Not Found

Thank you in advance for your help.

Michael

tomas.teicher’s picture

I have the same problem as in #10 prodigeek, using D7

johnnyk-1’s picture

Version: 7.x-1.x-dev » 7.x-1.2

having same problem, I am using D7.

video preview thumbs show up, but still get the error message when the white box opens: "Request unsuccessful: Forbidden."

has anyone had any luck solving this mystery?

joetower’s picture

I'm having the same issue.

tike012’s picture

I can verify the problem still persists.

In my case I am trying to bring up the comment form (id="comment-form") and my hook looks like this:

function hooks_reaction_colorbox_form_access($form_id) {
  $access = FALSE;

  if ($form_id == 'comment-form') {
    $access = TRUE; //or use user_access()
  }

  return $access;
}

I still get the Forbidden message after clearing caches and all that jazz.

ParisLiakos’s picture

try with 'comment_form'
it doesnt ask for the HTML id of the form.rather the value of the <input name="form_id"> :)

frjo’s picture

Category: bug » support
frjo’s picture

Status: Active » Closed (won't fix)

The attempt to support opening various forms in a Colorbox was in hindsight never a good idea. Form error handling and form redirects are complicated, a lot of code would be needed to do it correctly. The 7.x-2.x branch removes the form support from the Colorbox module.

midmood’s picture

I have the same problem,
anonymous users can't watch the video in the color box. Thumbnail correctly shown.
admin can.

I checked permissions, file types display many time, but can't find nothing relevant.

you can see the problem here: link to the videogallery