Problem/Motivation

When installing module on Cent-OS 5.7 Apache 2.2.3 PostgreSQL 8.4.3 I receive the following errors:

Notice: Array to string conversion in InsertQuery_pgsql->execute() (line 42 of /var/www/html/jcldocs/includes/database/pgsql/query.inc).
Notice: Array to string conversion in InsertQuery_pgsql->execute() (line 42 of /var/www/html/jcldocs/includes/database/pgsql/query.inc).
The content access permissions need to be rebuilt. Rebuild permissions.

I rebuild the permissions as it wants but when I try to enable access control on a vocabulary from /admin/config/people/taxonomy_access I get sent to /admin/config/people/taxonomy_access/role/[uid]/edit with the following errors:

Notice: Undefined index: access in _menu_translate() (line 778 of /var/www/html/jcldocs/includes/menu.inc).
Notice: Undefined index: access in menu_get_item() (line 464 of /var/www/html/jcldocs/includes/menu.inc).
Notice: Undefined index: access in menu_execute_active_handler() (line 499 of /var/www/html/jcldocs/includes/menu.inc).
CommentFileSizeAuthor
#5 1294986-hook_menu.patch990 bytesxjm

Comments

xjm’s picture

Notice: Array to string conversion in InsertQuery_pgsql->execute() (line 42 of /var/www/html/jcldocs/includes/database/pgsql/query.inc).
Notice: Array to string conversion in InsertQuery_pgsql->execute() (line 42 of /var/www/html/jcldocs/includes/database/pgsql/query.inc).

Could you provide a backtrace for these two notices? There is no indication they are even being caused by TAC.

The content access permissions need to be rebuilt. Rebuild permissions.

This message is normal.

Notice: Undefined index: access in _menu_translate() (line 778 of /var/www/html/jcldocs/includes/menu.inc).
Notice: Undefined index: access in menu_get_item() (line 464 of /var/www/html/jcldocs/includes/menu.inc).
Notice: Undefined index: access in menu_execute_active_handler() (line 499 of /var/www/html/jcldocs/includes/menu.inc).

This sounds like a problem with a corrupted menu. Try clearing your menu cache to see if it eliminates these notices. A backtrace would also be helpful.

darkooo’s picture

I have exactly the same problem on Ubuntu 11.10 and postgresql 9.1.

It's only appear when I activate the module, so I think the problem is in the module (I also tried to clear the cache and reinstalling it, not working).

and when i go here:
admin/config/people/taxonomy_access

I have the following errors:

Error message

    Notice: Undefined index: access in _menu_translate() (line 778 of /var/www/includes/menu.inc).
    Notice: Undefined index: access in menu_get_item() (line 464 of /var/www/includes/menu.inc).

You are not authorized to access this page.

Backtrace:

Notice: Undefined index: access in menu_execute_active_handler() (line 499 of /var/www/includes/menu.inc). =>

    ... (Array, 1 element)
        0: menu_execute_active_handler (Array, 4 elements)
            file (String, 18 characters ) /var/www/index.php
            line (Integer) 21
            function (String, 27 characters ) menu_execute_active_handler | (Callback) menu_execute_active_handler();
            args (Array, 0 elements)
    Called from /var/www/includes/menu.inc, line 499  
Notice: Undefined index: access in menu_local_tasks() (line 1845 of /var/www/includes/menu.inc). =>

    ... (Array, 14 elements)
        13: menu_local_tasks (Array, 4 elements)
            file (String, 26 characters ) /var/www/includes/menu.inc
            line (Integer) 2168
            function (String, 16 characters ) menu_local_tasks | (Callback) menu_local_tasks();
            args (Array, 0 elements)
        12: menu_tab_root_path (Array, 4 elements)
            file (String, 26 characters ) /var/www/includes/menu.inc
            line (Integer) 1631
            function (String, 18 characters ) menu_tab_root_path | (Callback) menu_tab_root_path();
            args (Array, 0 elements)
        11: menu_get_active_help (Array, 4 elements)
            file (String, 37 characters ) /var/www/modules/system/system.module
            line (Integer) 2059
            function (String, 20 characters ) menu_get_active_help | (Callback) menu_get_active_help();
            args (Array, 0 elements)
        10: system_block_view (Array, 2 elements)
            function (String, 17 characters ) system_block_view | (Callback) system_block_view();
            args (Array, 1 element)
        9: call_user_func_array (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/module.inc
            line (Integer) 795
            function (String, 20 characters ) call_user_func_array | (Callback) call_user_func_array();
            args (Array, 2 elements)
                0 (String, 17 characters ) system_block_view | (Callback) system_block_view();
                1 (Array, 1 element)
        8: module_invoke (Array, 4 elements)
            file (String, 35 characters ) /var/www/modules/block/block.module
            line (Integer) 834
            function (String, 13 characters ) module_invoke | (Callback) module_invoke();
            args (Array, 3 elements)
                0 (String, 6 characters ) system | (Callback) system();
                1 (String, 10 characters ) block_view
                2 (String, 4 characters ) help
        7: _block_render_blocks (Array, 4 elements)
            file (String, 35 characters ) /var/www/modules/block/block.module
            line (Integer) 658
            function (String, 20 characters ) _block_render_blocks | (Callback) _block_render_blocks();
            args (Array, 1 element)
                0 (Array, 1 element)
                    system_help (Object) stdClass
                        bid (String, 1 characters ) 9
                        module (String, 6 characters ) system | (Callback) system();
                        delta (String, 4 characters ) help
                        theme (String, 5 characters ) seven
                        status (String, 1 characters ) 1
                        weight (String, 1 characters ) 0
                        region (String, 4 characters ) help
                        custom (String, 1 characters ) 0
                        visibility (String, 1 characters ) 0
                        pages (String, 0 characters )
                        title (String, 0 characters )
                        cache (String, 2 characters ) -1
        6: block_list (Array, 4 elements)
            file (String, 35 characters ) /var/www/modules/block/block.module
            line (Integer) 315
            function (String, 10 characters ) block_list | (Callback) block_list();
            args (Array, 1 element)
                0 (String, 4 characters ) help
        5: block_get_blocks_by_region (Array, 4 elements)
            file (String, 35 characters ) /var/www/modules/block/block.module
            line (Integer) 268
            function (String, 26 characters ) block_get_blocks_by_region | (Callback) block_get_blocks_by_region();
            args (Array, 1 element)
                0 (String, 4 characters ) help
        4: block_page_build (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 5497
            function (String, 16 characters ) block_page_build | (Callback) block_page_build();
            args (Array, 1 element)
                0 (Array, 5 elements)
                    #show_messages (Boolean) TRUE
                    #theme (String, 4 characters ) page
                    #theme_wrappers (Array, 1 element)
                        0 (String, 4 characters ) html
                    #type (String, 4 characters ) page
                    content (Array, 2 elements)
                        system_main (Array, 4 elements)
                            main (Array, 1 element)
                                #markup (String, 43 characters ) You are not authorized to access this page.
                            #block (Object) stdClass
                                bid (String, 1 characters ) 8
                                module (String, 6 characters ) system | (Callback) system();
                                delta (String, 4 characters ) main
                                theme (String, 5 characters ) seven
                                status (String, 1 characters ) 1
                                weight (String, 1 characters ) 0
                                region (String, 7 characters ) content
                                custom (String, 1 characters ) 0
                                visibility (String, 1 characters ) 0
                                pages (String, 0 characters )
                                title (String, 0 characters )
                                cache (String, 2 characters ) -1
                                subject (String, 0 characters )
                            #weight (Integer) 1
                            #theme_wrappers (Array, 1 element)
                                0 (String, 5 characters ) block
                        #sorted (Boolean) TRUE
        3: drupal_render_page (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 2526
            function (String, 18 characters ) drupal_render_page | (Callback) drupal_render_page();
            args (Array, 1 element)
                0 (String, 43 characters ) You are not authorized to access this page.
        2: drupal_deliver_html_page (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 2437
            function (String, 24 characters ) drupal_deliver_html_page | (Callback) drupal_deliver_html_page();
            args (Array, 1 element)
        1: drupal_deliver_page (Array, 4 elements)
            file (String, 26 characters ) /var/www/includes/menu.inc
            line (Integer) 518
            function (String, 19 characters ) drupal_deliver_page | (Callback) drupal_deliver_page();
            args (Array, 2 elements)
                0 (Integer) 3
                1 (String, 0 characters )
        0: menu_execute_active_handler (Array, 4 elements)
            file (String, 18 characters ) /var/www/index.php
            line (Integer) 21
            function (String, 27 characters ) menu_execute_active_handler | (Callback) menu_execute_active_handler();
            args (Array, 0 elements)
    Called from /var/www/includes/menu.inc, line 1845  
Notice: Undefined index: access in menu_tree_page_data() (line 1167 of /var/www/includes/menu.inc). =>

    ... (Array, 10 elements)
        9: menu_tree_page_data (Array, 4 elements)
            file (String, 26 characters ) /var/www/includes/menu.inc
            line (Integer) 1762
            function (String, 19 characters ) menu_tree_page_data | (Callback) menu_tree_page_data();
            args (Array, 2 elements)
                0 (String, 9 characters ) main-menu
                1 (Integer) 1
        8: menu_navigation_links (Array, 4 elements)
            file (String, 26 characters ) /var/www/includes/menu.inc
            line (Integer) 1726
            function (String, 21 characters ) menu_navigation_links | (Callback) menu_navigation_links();
            args (Array, 1 element)
                0 (String, 9 characters ) main-menu
        7: menu_main_menu (Array, 4 elements)
            file (String, 27 characters ) /var/www/includes/theme.inc
            line (Integer) 2271
            function (String, 14 characters ) menu_main_menu | (Callback) menu_main_menu();
            args (Array, 0 elements)
        6: template_preprocess_page (Array, 4 elements)
            file (String, 27 characters ) /var/www/includes/theme.inc
            line (Integer) 858
            function (String, 24 characters ) template_preprocess_page | (Callback) template_preprocess_page();
            args (Array, 2 elements)
                0 (Array, 23 elements)
                1 (String, 4 characters ) page
        5: theme (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 5634
            function (String, 5 characters ) theme | (Callback) theme();
            args (Array, 2 elements)
                0 (String, 4 characters ) page
                1 (Array, 7 elements)
        4: drupal_render (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 5510
            function (String, 13 characters ) drupal_render | (Callback) drupal_render();
            args (Array, 1 element)
                0 (Array, 7 elements)
        3: drupal_render_page (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 2526
            function (String, 18 characters ) drupal_render_page | (Callback) drupal_render_page();
            args (Array, 1 element)
                0 (String, 43 characters ) You are not authorized to access this page.
        2: drupal_deliver_html_page (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 2437
            function (String, 24 characters ) drupal_deliver_html_page | (Callback) drupal_deliver_html_page();
            args (Array, 1 element)
                0 (Integer) 3
        1: drupal_deliver_page (Array, 4 elements)
            file (String, 26 characters ) /var/www/includes/menu.inc
            line (Integer) 518
            function (String, 19 characters ) drupal_deliver_page | (Callback) drupal_deliver_page();
            args (Array, 2 elements)
        0: menu_execute_active_handler (Array, 4 elements)
            file (String, 18 characters ) /var/www/index.php
            line (Integer) 21
            function (String, 27 characters ) menu_execute_active_handler | (Callback) menu_execute_active_handler();
            args (Array, 0 elements)
    Called from /var/www/includes/menu.inc, line 1167  
Notice: Undefined index: access in menu_tree_page_data() (line 1200 of /var/www/includes/menu.inc). =>

    ... (Array, 10 elements)
        9: menu_tree_page_data (Array, 4 elements)
            file (String, 26 characters ) /var/www/includes/menu.inc
            line (Integer) 1762
            function (String, 19 characters ) menu_tree_page_data | (Callback) menu_tree_page_data();
            args (Array, 2 elements)
                0 (String, 9 characters ) main-menu
                1 (Integer) 1
        8: menu_navigation_links (Array, 4 elements)
            file (String, 26 characters ) /var/www/includes/menu.inc
            line (Integer) 1726
            function (String, 21 characters ) menu_navigation_links | (Callback) menu_navigation_links();
            args (Array, 1 element)
                0 (String, 9 characters ) main-menu
        7: menu_main_menu (Array, 4 elements)
            file (String, 27 characters ) /var/www/includes/theme.inc
            line (Integer) 2271
            function (String, 14 characters ) menu_main_menu | (Callback) menu_main_menu();
            args (Array, 0 elements)
        6: template_preprocess_page (Array, 4 elements)
            file (String, 27 characters ) /var/www/includes/theme.inc
            line (Integer) 858
            function (String, 24 characters ) template_preprocess_page | (Callback) template_preprocess_page();
            args (Array, 2 elements)
                0 (Array, 23 elements)
                1 (String, 4 characters ) page
        5: theme (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 5634
            function (String, 5 characters ) theme | (Callback) theme();
            args (Array, 2 elements)
                0 (String, 4 characters ) page
                1 (Array, 7 elements)
        4: drupal_render (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 5510
            function (String, 13 characters ) drupal_render | (Callback) drupal_render();
            args (Array, 1 element)
                0 (Array, 7 elements)
        3: drupal_render_page (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 2526
            function (String, 18 characters ) drupal_render_page | (Callback) drupal_render_page();
            args (Array, 1 element)
                0 (String, 43 characters ) You are not authorized to access this page.
        2: drupal_deliver_html_page (Array, 4 elements)
            file (String, 28 characters ) /var/www/includes/common.inc
            line (Integer) 2437
            function (String, 24 characters ) drupal_deliver_html_page | (Callback) drupal_deliver_html_page();
            args (Array, 1 element)
                0 (Integer) 3
        1: drupal_deliver_page (Array, 4 elements)
            file (String, 26 characters ) /var/www/includes/menu.inc
            line (Integer) 518
            function (String, 19 characters ) drupal_deliver_page | (Callback) drupal_deliver_page();
            args (Array, 2 elements)
                0 (Integer) 3
                1 (String, 0 characters )
        0: menu_execute_active_handler (Array, 4 elements)
            file (String, 18 characters ) /var/www/index.php
            line (Integer) 21
            function (String, 27 characters ) menu_execute_active_handler | (Callback) menu_execute_active_handler();
            args (Array, 0 elements)
    Called from /var/www/includes/menu.inc, line 1200  
xjm’s picture

Excellent, thank you for the backtraces. A couple of followup questions based on the information there:

  1. Are you using PHP 5.2 or 5.3?
  2. When you receive these errors, are the TAC administration pages at all usable, or is nothing displayed?
  3. What permissions does the current user have when you receive these errors?
    • Are you logged in as user 1?
    • If not, are you logged in as a user that has the "administrator" role?
    • If not, does the user have the "administer permissions" permission?
  4. Do you also have a backtrace for the array to string conversion error?
darkooo’s picture

Are you using PHP 5.2 or 5.3?

PHP Version 5.3.6-13ubuntu3.1

When you receive these errors, are the TAC administration pages at all usable, or is nothing displayed?

When i am here: admin/config/people/taxonomy_access
I can see the page with Roles (anonymous, authenticated, administrator...) and Operations (edit access rules for anonymous and authenticated role, then enable access control for administrator role)
Then when i click on one of the Operations displayed, I got the error

Access denied, Error message

    Notice: Undefined index: access in _menu_translate() (line 778 of /var/www/includes/menu.inc).
    Notice: Undefined index: access in menu_get_item() (line 464 of /var/www/includes/menu.inc).

You are not authorized to access this page.

With the back trace I gave you before.

What permissions does the current user have when you receive these errors?

Are you logged in as user 1?

I'am user 1 (so no problem of permissions)

Do you also have a backtrace for the array to string conversion error?

I had the error only the first time I install the module. Now when I try to reinstall it with back trace activated, no errors :S. Don't know why. I also tried to delete the two tables taxonomy_access in my data base, and reactivate the module, but even after that the error disappear, don't know why. If it comes back, I will post it.

Thanks.

xjm’s picture

Status: Active » Needs review
StatusFileSize
new990 bytes

Alright, I've found what might be a bug in hook_menu() that relates to the menu data above. Please try the following:

  1. Disable TAC at admin/modules.
  2. Uninstall TAC at admin/modules/uninstall.
  3. Clear the site cache at admin/config/development/performance.
  4. Apply the attached patch.
  5. Enable TAC at admin/modules and see if the errors still occur.
darkooo’s picture

Status: Needs review » Fixed

Thanks a lot xjm, it's working now :)

xjm’s picture

Status: Fixed » Reviewed & tested by the community
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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