Comments

amocsy’s picture

http://localhost/mysite/content/test_page#overlay=admin/config/system/ct...

1. Clicked on a custom content to tick it.
2. Clicked on save

Of course after the Notice message in the topic, the page of that content type do not pop up in modal.

The path associated with that content type is like this:
http://localhost/mysite/home
And the page I tried to test is:
http://localhost/mysite/home/fooldal

jeremymcminn’s picture

Also getting this error message.

jeremymcminn’s picture

Changed line 23 from

if ($item['page callback'] == 'drupal_get_form') {

to

if (isset($item['page callback']) == 'drupal_get_form') {

and commenting out line 32 removed the notices, however the edit link still doesn't open in a modal window.

jim_at_miramontes’s picture

isset() returns true on success, not the value of the thing you're testing, so your edit of line 23 is unlikely to do what you intended. I'm also pretty sure that a debugged version of line 32 is needed, so commenting the bug away will probably also not work.

In any case, I was able to get it to work by redefining that function like so:

function ctools_automodal_menu_alter(&$items) {
  $modal_paths = array();

  foreach ($items as $path => $item) {
    if (!empty($item['modal']) && strpos($path, '%ctools_js') === FALSE) {
      if (isset($item['page callback']) && ($item['page callback'] == 'drupal_get_form')) {
        $items["$path/%ctools_js"] = $item;
        $items["$path/%ctools_js"]['page callback'] = 'ctools_automodal_get_form';
        $items["$path/%ctools_js"]['page arguments'][] = substr_count($path, '/') + 1;
        $items["$path/%ctools_js"]['type'] = MENU_CALLBACK;
      }
      else {
        $items["$path/%ctools_js"] = $item + array('page arguments' => array());
        $items["$path/%ctools_js"]['page callback'] = 'ctools_automodal_get_page';
        if (isset($item['page callback'])) {
	        array_unshift($items["$path/%ctools_js"]['page arguments'], $item['page callback']);
	    }
        $items["$path/%ctools_js"]['page arguments'][] = substr_count($path, '/') + 1;
        $items["$path/%ctools_js"]['type'] = MENU_CALLBACK;
      }
      $modal_paths[] = preg_replace('/%[^\/]+/', '*', $path);
    }
  }

  variable_set('ctools_automodal_paths', $modal_paths);
}

This at least got it to the point where I was getting modal forms when *creating* nodes of a type I specified via the ctools_automodal_admin module. However, I haven't been able to get it to work with editing the same nodes, or (what I really wanted) deleting them -- it's doing something funky with node permissions that's getting in the way of any sort of editing-related changes.

FWIW, this module is looking a little neglected in terms of update history, so I'm not sure what it's future is...

Leonid.Kuznetsov’s picture

Issue summary: View changes

1. Main goal of this module is to provide UI interface for CTools Automodal module which it does. CTools Automodal module works only with menu item pathes which collected by hook_menu(). So it is possible to make all node page, node edit and node delete links regardless of node type to be automodal by putting

node/%node
node/%node/edit
node/%node/delete

into 'Extra modal links' field at 'admin/config/system/ctools_automodal_admin'. But there is no way to make link just for single node like 'node/5' (nor pathauto aliases for it) to become automodal. This is restriction of CTools Automodal module and we have no intention to change this in our module.

2. Checkboxes at 'admin/config/system/ctools_automodal_admin' only enable 'node/add/*' pages to be automodal. They do not affect node edit pages at all. As I mentioned you can make node edit page automodal by putting 'node/%node/edit' into 'Extra modal links' field at 'admin/config/system/ctools_automodal_admin'. We should clarify this in module description.

3. It seems source of notice in header is incorrect path entered into 'Extra modal links' field. We'll add some checks to make sure that every entered path has corresponding menu item for it. This should get rid of notice.

Leonid.Kuznetsov’s picture

Status: Active » Fixed

Please upgrade module to a CTools Auto-modal Admin Interface 7.x-1.1 to get rid of notice.

Status: Fixed » Closed (fixed)

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