"user warning: Table 'iconra_cms1.drupal_printfriendly_node' doesn't exist query: SELECT printfriendly_override FROM drupal_printfriendly_node WHERE nid = 225 in /home/iconra/public_html/media/drupal/modules/printfriendly/printfriendly.module on line 108."

I'm getting this (or a similar error, but with a different nid) error on admin/build/modules and all my node pages after installing and enabling printfriendly. Has installation not worked properly? Any ideas how I can fix this? Any tables to create or a SQL statement I can run?

Thanks.

Comments

Phil Wolstenholme’s picture

Obviously iconra_cms1.drupal_ is just specific to my server and Drupal table prefix :)

anon’s picture

Status: Active » Needs review

It looks like the script cant find the database table.

If you still have the same error, try running

CREATE TABLE `printfriendly_node` (
  `nid` int(10) unsigned NOT NULL default '0',
  `printfriendly_override` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`nid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Phil Wolstenholme’s picture

I tried that (thank you very much for such a quick response!) but even then the button did not appear, even with permissions set, the 'show on nodes' checkbox checked in printfriendly settings, and printfriendly enabled for the content type...

I think installation might have been aborted, as my admin/modules section sometimes comes up with an error, or takes too long to load so I stop and click the update button again. I'm thinking I might have messed up the installation, so I might try and remove all traces of printfriendly and then reinstall it - unless you can think of anything else I should try? What should I delete? The module files, the printfriendly_node, printfriendly rows in the variables table?

Thanks for your help anon!

anon’s picture

Try uninstalling it (admin/build/modules/uninstall), the uninstall hook will delete the printfriendly table and all the printfriendly variables in the variable table.

Then try installing it again.

anon’s picture

Assigned: Unassigned » anon
Phil Wolstenholme’s picture

Hmm, the plot thickens!

There isn't a printfriendly entry in the table of modules with uninstall hooks!

anon’s picture

Oh sorry, forgot to tell you that you have to disable the module first.

When the module is disabled it will apper in the uninstall table.

Phil Wolstenholme’s picture

Thanks for the uninstall tip! Oops...

I get "warning: Invalid argument supplied for foreach() in /home/iconra/public_html/media/drupal/includes/common.inc on line 3216." when enabling the module after reinstalling it, and the button still does not appear in the links section of a node, still, at least there are no database errors this time.

So the module is enabled, permissions set, in printfriendly settings the show on all nodes checkbox is set, just to be safe under my content type printfriendly is also set, but still nothing is being output to the links section :(

Phil Wolstenholme’s picture

Ah, I've just been to a node edit page and found that I have to enable printfriendly per node. Even with creating new nodes by default the 'Show a printfriendly button on this node' is not selected, so no button is added.

Could it be made so that enabling printfriendly adds buttons to all nodes without having to do it manually? Unless I've configured the module incorrectly (which is entirely possible!) it seems a bit off having things set up this way :)

anon’s picture

The foreach() error has something todo with the installation of the database table.
Perhaps it was just a one-time-error?

You can enable the 'Show a printfriendly button on this node' for all new content, but not the old right now.

Your suggestion is good :), I'll see what I can do to create a function that will set the "Show a printfriendly button on this node" flag on all old nodes to. Feel free to post a "feature request".

Do you consider this issue as solved?

Phil Wolstenholme’s picture

Status: Needs review » Fixed

Yes thanks, I'll raise a feature request later :)

Status: Fixed » Closed (fixed)

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