After upgrading to 7.x-1.12 got a few warnings on one of my sites:

Warning: file_exists(): open_basedir restriction in effect. File(../block/icon_core_booknavigation.png) is not within the allowed path(s): (//customers/f/b/0/stoops.es//httpd.www://customers/f/b/0/stoops.es//httpd.private://customers/f/b/0/stoops.es//tmp:/customers/stoops.es/stoops.es:/var/www/diagnostics:/usr/share/php) in ctools_content_admin_icon() (regel 419 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/content.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

luk.stoops created an issue. See original summary.

luk.stoops’s picture

Title: warnings afther upgrading to 7.x-1.12 » warnings after upgrading to 7.x-1.12
rivimey’s picture

Hi, thanks for the report. Looking at the other plugins, the pattern is to not include any path in the icon filename.
Could you confirm if editing node_book_nav.inc like this works (i.e. there's still an icon in the admin pages) and makes the error go away?

+  $booknavicon = ctools_plugin_get_directories(ctools_plugin_get_info('ctools', 'content_type'));
+  $booknavicon = $booknavicon['block'] . '/icon_core_booknavigation.png';
  $plugin = array(
     'single' => TRUE,
     'title' => t('Book navigation pager'),
-    'icon' => '../block/icon_core_booknavigation.png',
+    'icon' =>  $booknavicon,
     'description' => t('The navigational pager and sub pages of the current book node.'),
     'required context' => new ctools_context_required(t('Node'), 'node'),
     'category' => t('Node'),

[Please note - this is not intended as a final patch, just as a test]

donaldp’s picture

I've also had similar warnings. Although the book modules was installed on this particular site, there was no content actually using it. So I fixed the warnings by disabling the book module.

Not sure if it's relevant to your change but before I disabled the module I did try your code above but got.

Undefined index: module in ctools_plugin_get_directories() (line 527 of /var/www/vhosts/readyweb-servers.co.uk/drupal.7/html/sites/all/modules/ctools/includes/plugins.inc).

Undefined index: type in ctools_plugin_get_directories() (line 527 of /var/www/vhosts/readyweb-servers.co.uk/drupal.7/html/sites/all/modules/ctools/includes/plugins.inc).

Undefined index: block in include_once() (line 9 of /var/www/vhosts/readyweb-servers.co.uk/drupal.7/html/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc).

If it would be any help I could try something else as I think my matching dev server version should be able to duplicate this.

luk.stoops’s picture

Hi,
I tried the suggested modifications on node_book_nav.inc
This is what I get now after the database update:

Notice: Undefined index: module in ctools_plugin_get_directories() (regel 527 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/plugins.inc).
Notice: Undefined index: type in ctools_plugin_get_directories() (regel 527 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/plugins.inc).
Notice: Undefined index: module in ctools_plugin_get_directories() (regel 527 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/plugins.inc).
Notice: Undefined index: type in ctools_plugin_get_directories() (regel 527 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/plugins.inc).
Notice: Undefined index: module in ctools_plugin_get_directories() (regel 527 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/plugins.inc).
Notice: Undefined index: type in ctools_plugin_get_directories() (regel 527 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/plugins.inc).
Notice: Undefined index: block in include_once() (regel 11 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc).
Warning: file_exists(): open_basedir restriction in effect. File(../block/icon_core_block_menu.png) is not within the allowed path(s): (//customers/f/b/0/stoops.es//httpd.www://customers/f/b/0/stoops.es//httpd.private://customers/f/b/0/stoops.es//tmp:/customers/stoops.es/stoops.es:/var/www/diagnostics:/usr/share/php) in ctools_content_admin_icon() (regel 419 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/content.inc).

luk.stoops’s picture

Just to be complete, these are the messages i get after restoring the original node_book_nav.inc

Warning: file_exists(): open_basedir restriction in effect. File(../block/icon_core_booknavigation.png) is not within the allowed path(s): (//customers/f/b/0/stoops.es//httpd.www://customers/f/b/0/stoops.es//httpd.private://customers/f/b/0/stoops.es//tmp:/customers/stoops.es/stoops.es:/var/www/diagnostics:/usr/share/php) in ctools_content_admin_icon() (regel 419 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/content.inc).
Warning: file_exists(): open_basedir restriction in effect. File(../block/icon_core_block_menu.png) is not within the allowed path(s): (//customers/f/b/0/stoops.es//httpd.www://customers/f/b/0/stoops.es//httpd.private://customers/f/b/0/stoops.es//tmp:/customers/stoops.es/stoops.es:/var/www/diagnostics:/usr/share/php) in ctools_content_admin_icon() (regel 419 van /customers/f/b/0/stoops.es/httpd.www/sites/all/modules/ctools/includes/content.inc).

bessone’s picture

Same problem to me, with book module enabled.

This is my quick and dirty fix:

<?php
  $plugin = array(
    'single' => TRUE,
    'title' => t('Book navigation pager'),
-    'icon' => '../block/icon_core_booknavigation.png',
+   'icon' => drupal_get_path('module', 'ctools') . '/plugins/content_types/block/icon_core_booknavigation.png',
    'description' => t('The navigational pager and sub pages of the current book node.'),
    'required context' => new ctools_context_required(t('Node'), 'node'),
    'category' => t('Node'),
  );
?>
bessone’s picture

same problem for another file

Warning: file_exists(): open_basedir restriction in effect. File(../block/icon_core_block_menu.png) is not within the allowed path(s): (/var/www/clients/client1/web1/web:/var/www/clients/client1/web1/private:/var/www/clients/client1/web1/tmp:/var/www/xxx.com/web:/srv/www/xxx.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in ctools_content_admin_icon() (linea 419 di /var/www/clients/client1/web1/web/sites/all/modules/ctools/includes/content.inc).

dirty fix:

<?php
  $plugin = array(
    'single' => TRUE,
    'title' => t('Book navigation menu'),
-    'icon' => '../block/icon_core_block_menu.png',
+    'icon' => drupal_get_path('module', 'ctools') . '/plugins/content_types/block/icon_core_block_menu.png',
    'description' => t('The book menu belonging to the current book node.'),
    'required context' => new ctools_context_required(t('Node'), 'node'),
    'category' => t('Node'),
  );
?>
rivimey’s picture

Would the best solution be to copy or move the book navigation icons into the correct plugin folder so they can be accessed locally?

bessone’s picture

Assigned: Unassigned » bessone
Status: Active » Needs review
FileSize
1.48 KB

For convenience I did the patch either modifice code in the comments #7 and #8.

Changing status to "Needs review"

darrenwh’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +repl

Code checks out RTBC

rivimey’s picture

Assigned: bessone » Unassigned
rivimey’s picture

  • japerry committed 1a8fe97 on 7.x-1.x authored by bessone
    Issue #2829691 by bessone: warnings after upgrading to 7.x-1.12
    
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Pretty straightforward. Fixed!

Status: Fixed » Closed (fixed)

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