Pay-per-node don't seem to work on installs where i18n is active.

On a fresh install of drupal-7.18 these modules are enabled : Content translation 7.18, Locale 7.18, Chaos tools 7.x-1.2, i18n 7.x-1.7, Variable 7.x-2.1 and Views 7.x-3.5.
After enabling pay-per-node 7.x-1.0, when I execute admin/content/Add content, I get this fatal error : require_once() [function.require]: Failed opening required 'C:\wamp\www\drupal-7.18/modules/node/i18n_node.pages.inc' (include_path='.;C:\wamp\bin\php\php5.3.13\pear') in C:\wamp\www\drupal-7.18\includes\menu.inc on line 515.

When Ubercart is active, I have the same problem reported at http://drupal.org/node/1220936.

Comments

maurizio.ganovelli’s picture

Assigned: Unassigned » maurizio.ganovelli
Status: Active » Needs review

After i tried this configuration (same version for all modules), i discovered that this issue can be solved by commenting line 102 on paypernode.module file. Try to do this and let me know, the line in question is

$items['node/add']['file path'] = drupal_get_path('module', 'node');

i think that this solves also the other problem with Ubercart (http://drupal.org/node/1220936).

Ted51’s picture

Commenting line 102 of paypernode.module file produces this new fatal error : Call to undefined function node_add_page() in C:\wamp\www\drupal-7.18\sites\all\modules\paypernode\paypernode.module on line 248

maurizio.ganovelli’s picture

You're right, this happens when user has rights to create node with normal permission system.
In this case the solution is to add this line:

module_load_include('inc', 'node', 'node.pages');

at the begin of paypernode_node_add_page() function (right after "global $user;").
After this i can correctly create nodes without errors (as administrator or normal user through ppn): let me know, i will provide and commit a patch if it works.

Ted51’s picture

#3 corrects the fatal error when creating a node as administrator or normal user.
When I delete the node through ppn, admin/settings/paypernode/Overview still indicates that the node is ceated. After that, I can create many nodes like I want.

maurizio.ganovelli’s picture

When I delete the node through ppn, admin/settings/paypernode/Overview still indicates that the node is ceated

This behaviour is "by design": once deleted, node is not automatically re-charged in ppn user balance. However this is possible because nodes created with ppn are tracked in a db table, but is more like a feature request, not a real bug.

After that, I can create many nodes like I want

Please note that the user that creates a new content with ppn must not have the permission to create that content type. In this case, ppn system check will be skipped (since user can create unlimited number of contents of this type).

Ted51’s picture

I agree with you. Very usefull module ! Thank you.

Ted51’s picture

Another bug. Consider this case : the role authenticated user has no permission on the content type "Article" but has permissions on the content type "Basic page". Execution of node/add by an authenticted user which can use ppn to create an article generates this fatal error : Call to undefined function node_get_types() in C:\wamp\www\drupal-7.18\sites\all\modules\paypernode\paypernode.module on line 253

Ted51’s picture

Hi blackice78,

Have you a solution for the fatal error reported at #7 ?

Thanks for your help.

maurizio.ganovelli’s picture

Version: 7.x-1.0 » 7.x-2.x-dev
Priority: Normal » Major
Status: Needs review » Fixed

Hi Ted51, please check the new dev snapshot (7.x-2.x-dev, you can take it from http://drupalcode.org/project/paypernode.git or wait that it become available on project page) and let me know if it solves this issue.

Status: Fixed » Closed (fixed)

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

xamount’s picture

Issue summary: View changes
Status: Closed (fixed) » Active

Regarding comment #7, I tried the solution suggested at #9 and it did not solve the problem. After trying #9 and I try to create a node, I get the following page "You have not created any content types yet. Go to the content type creation page to add a new content type."

maurizio.ganovelli’s picture

Hi xamount, i've tested paypernode version 2.x with Drupal 7.28 and Internationalization 1.11. On a fresh install i downloaded and enabled paypernode and all i18n modules.
After this, once enabled allowed content types (admin/settings/paypernode/allowed) and created a new user with assigned some articles, i'm able to create nodes with ppn using the new account.
The node/add page give me no errors or warnings.
Can you explain me the steps to reproduce and post some info (module version, error returned ...)?