I just installed the module on my website and am getting the following error:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'protected_node_is_protected' in 'field list': SELECT protected_node_is_protected, protected_node_passwd, protected_node_passwd_changed, protected_node_show_title, protected_node_hint FROM {protected_nodes} WHERE nid = :nid; Array ( [:nid] => 1 ) in protected_node_load() (line 752 of /home/bluesky/public_html/sites/all/modules/protected_node/protected_node.module).

I ran update.php, but no updates were found.

Comments

AlexisWilke’s picture

There shouldn't be any updates yet, the module is pretty much brand new! 8-)

I checked just in case, I only maintain 6.x, but was wondering whether the field would have been removed.

The .install script includes the field in the schema. Not too sure why it wouldn't work...

      'protected_node_is_protected' => array(
        'description' => 'Whether this node is currently protected.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
keith_k’s picture

Sorry I wasn't clear at first. The problem is that nothing happens when I run update.php. The message I get is "Installation tasks: No pending updates." Sorry for the confusion around the word "updates."

AlexisWilke’s picture

keith_k,

Did you do an upgrade from 6.x to 7.x or just a new install in 7.x?

In the first case, it would be a transition problem, although I think that the table hasn't changed. If it's a new install, then you never get an update.php on new installs anyway.

Thank you.
Alexis

keith_k’s picture

I had an existing 7.X website and tried to install the module using the normal proceedure (download the module, enable it, go to update.php). As soon as the module was enabled, I started getting the error message (on any page with 1 or more nodes).

zilverdistel’s picture

keith_k,

I tried to reproduce the error by installing the module on a vanilla drupal 7 install and adding some nodes, but I didn't experience any problems.

Maybe something went wrong during installation. Could you try disabling, uninstalling (explicitly!) and then re-installing the module? Did you find any related messages in the watchdog log?

thanx,

zilverdistel

keith_k’s picture

I uninstalled completely and then reenabled the module. I then got this error message at the top of my home page.

Error message

    Warning: Illegal offset type in isset or empty in drupal_lookup_path() (line 158 of /home/bluesky/public_html/includes/path.inc).
    Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2135 of /home/bluesky/public_html/includes/database/database.inc).
    Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2135 of /home/bluesky/public_html/includes/database/database.inc).
    Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2135 of /home/bluesky/public_html/includes/database/database.inc).
    PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 'coloradoblueskycounseling.com', '', '', '', '/', 'Array', 'coloradoblueskycoun' at line 1: SELECT source FROM {url_alias} WHERE alias = :alias_scheme, :alias_host, :alias_path, :alias_query, :alias_full_path, :alias_base_path, :alias_query_array, :alias_url_full, :alias_url, :alias_url_decoded, :alias_base_dir, :alias_filename, :alias_directory, :alias_normal_path, :alias_path_alias, :alias_args, :alias_menu_item, :alias_is_cacheable AND language IN (:language, :language_none) ORDER BY language ASC, pid DESC; Array ( [:language] => en [:language_none] => und [:alias_scheme] => http [:alias_host] => coloradoblueskycounseling.com [:alias_path] => [:alias_query] => [:alias_full_path] => [:alias_base_path] => / [:alias_query_array] => Array ( ) [:alias_url_full] => coloradoblueskycounseling.com/_ [:alias_url] => http://coloradoblueskycounseling.com/ [:alias_url_decoded] => /_ [:alias_base_dir] => cache/normal/coloradoblueskycounseling.com/ [:alias_filename] => cache/normal/coloradoblueskycounseling.com/_ [:alias_directory] => cache/normal/coloradoblueskycounseling.com [:alias_normal_path] => node/1 [:alias_path_alias] => welcome [:alias_args] => Array ( [0] => node [1] => 1 [2] => ) [:alias_menu_item] => Array ( [page_type] => page [page_id] => 1 [path] => node/% [load_functions] => Array ( [1] => node_load ) [to_arg_functions] => [access_callback] => node_access [access_arguments] => a:2:{i:0;s:4:"view";i:1;i:1;} [page_callback] => node [delivery_callback] => [fit] => 2 [number_parts] => 2 [context] => 0 [tab_parent] => [tab_root] => node/% [title] => Michelle Kranker [title_callback] => node_page_title [title_arguments] => a:1:{i:0;i:1;} [theme_callback] => [theme_arguments] => Array ( ) [type] => 6 [description] => [position] => [weight] => 0 [include_file] => [href] => node/1 [tab_root_href] => node/1 [tab_parent_href] => [options] => Array ( ) [access] => 1 [localized_options] => Array ( ) [original_map] => Array ( [0] => node [1] => 1 ) [status] => 200 [extra_arguments] => ) [:alias_is_cacheable] => 1 ) in drupal_lookup_path() (line 176 of /home/bluesky/public_html/includes/path.inc).

these errors were in the log:

- Warning: Illegal offset type in isset or empty in drupal_lookup_path() (line 158 of /home/bluesky/public_html/includes/path.inc).
- Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2135 of /home/bluesky/public_html/includes/database/database.inc).
- Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2135 of /home/bluesky/public_html/includes/database/database.inc).
- Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2135 of /home/bluesky/public_html/includes/database/database.inc).

keith_k’s picture

Just realized the errors go away if I disable Boost.

AlexisWilke’s picture

In D6 there was a function to "support" boost (avoid the cache on protected nodes) with this function:

function protected_node_boost_is_cacheable($path);

It probably changed in D7!

At this point, commenting out that function may help, although if a node is "de-protected" by an anonymous user and boost caches it... it becomes public.

Thank you.
Alexis

patrickroma’s picture

Is there an updated version for 7.x to support boost?

izus’s picture

Title: Column not found » Support boost module
Category: Bug report » Feature request
Issue summary: View changes
grimreaper’s picture

Assigned: Unassigned » grimreaper
Status: Active » Needs review
StatusFileSize
new1.14 KB

Hello,

Here is a patch that prevents the site from crashing when boost and protected_node are enabled simultaneously.

As I discover how to use boost module with this issue, I don't know if it's ok or not.

I just check that if an anonymous user access a protected node, another anonymous user (I test using another web browser) can't access this node without entering the password.

Thanks for the review and the test.

grimreaper’s picture

StatusFileSize
new1.14 KB

I have remade the patch because the last one was no more applyable.

malberts’s picture

#12 seems to work with the latest dev so far.

izus’s picture

Status: Needs review » Fixed

Ok thanks for testing and for the patch
this is now merged

Status: Fixed » Closed (fixed)

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

grimreaper’s picture

Assigned: grimreaper » Unassigned