This might be a case of user error, however after installing and enabling Dice Roller and adding it to the Forum content type, attempting to post an entry that makes use of the dice roller yields the following result:

Fatal error: Call to undefined function _dice_roller_parse_roll() in /sites/all/modules/dice_roller/dice_roller_basic/dice_roller_basic.module on line 63

Running Drupal 7.12

Comments

Salias’s picture

Tracked this down to being an issue specifically with using dice rolls in comments. Module works perfectly otherwise.

chintan.vyas’s picture

Assigned: Unassigned » chintan.vyas
Status: Active » Needs review
StatusFileSize
new699 bytes

Hi Salias,

Attaching the patch for this issue. Can you please review this issue after applying attached patch?

Regards,
Chintan Vyas.

Salias’s picture

The patch definitely appears to have resolved the issues

Thank you!

chintan.vyas’s picture

Closing this issue as patch resolved the issue. Let me know if you find any bug later.

Regards,
Chintan Vyas.

chintan.vyas’s picture

Status: Needs review » Fixed
chintan.vyas’s picture

@Bastlynn Can you apply patch to the module? Use this patch its containing author info.

Thanks.

chintan.vyas’s picture

StatusFileSize
new1.01 KB

Forgot to attach patch :P

Status: Fixed » Closed (fixed)

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

spouilly’s picture

Version: 7.x-1.6 » 7.x-1.7
Status: Closed (fixed) » Patch (to be ported)

Hi there,

The bug is still present in the latest version (1.7) of dice_roller ... because the patch #7 has not been applied although the previous status of the bug was "closed".

I am reopenning the issue so that the maintener can fix the latest tree (note: fix is super simple and can be applied manually easily).

Cheers,

S.

spouilly’s picture

Issue summary: View changes

I've heard the version of Drupal may help...!

Bastlynn’s picture

A couple of things with this patch to look at.

First, you generall want to put the include inside of the function, so the extra code is only included when it's called for. This gives you a small boost to performance since it reduces the code footprint.

Second, by the time the basic module is being invoked for these features (calling the form) the dice roller include is already be included by the core roller.

This is the function that calls the forum_submit hook you were looking at in basic:

/**
 * Implements hook_node_update().
 */
function dice_roller_node_update($node) {
  if (user_access('use dice roller')) {
    module_load_include('inc', 'dice_roller', 'dice_roller.roller');
    $form_provider = variable_get('dice_roller_form_'. $node->type, 'dice_roller_basic');
    module_invoke($form_provider, 'dice_roller_form_submit', $node, 'node');
  }
}
Bastlynn’s picture

Issue summary: View changes
Status: Patch (to be ported) » Closed (cannot reproduce)

I've just not been able to replicate the behavior you're seeing. 1.7 is in active use on one of my own websites and we're just not seeing the issue there. I would suggest reinstalling if you're seeing it on your end, making sure you've got the latest version.

Bastlynn’s picture

Status: Closed (cannot reproduce) » Fixed

AH! I think I see how this is getitng pulled. One moment. The place to put the call is under function dice_roller_comment_update($comment) {} to reflect the node's include. I have no idea why I'm not seeing it on my end where you're seeing it on yours - perhaps forum handles node comments differently than the non-forum code I've been looking at.

Fixed under:
[7.x-1.x 55baad7] Issue #1524340 by Bastlynn: Fatal error: Call to undefined function _dice_roller_parse_roll() (Forum specific)

Patch now in dev.

Status: Fixed » Closed (fixed)

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