We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Unable to get action ID using fetch_action_id when not logged in

Development and Programming

OutofControl's avatar
OutofControl
164 posts
14 years ago
OutofControl's avatar OutofControl

Using EE 1.7.1 and writing a module. I have the module working great when logged in. However, when I am not logged in, I can’t get the action ID.

Using:

$FNS->fetch_action_id( $class_name, $method_name );
       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
14 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team

James,

What does the code look like surrounding the code you provided? I whipped up a test plugin that successfully uses the code you provided for both logged in users and site guests. It was also in 1.7.1. (I just tested against an existing action in the database).

Thanks Erik

       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
14 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team

Here’s the code I used to test:

<?php

$plugin_info       = array(
    'pi_name'        => 'For James',
    'pi_version'     => '1',
    'pi_author'      => 'Erik Reagan',
    'pi_author_url'  => '',
    'pi_description' => 'Testing something for James',
    'pi_usage'       => ''
);

class For_james
{
    
    public $return_data  = "";
    
    public function For_james()
    {
        global $FNS;
        $this->return_data = $FNS->fetch_action_id('Member','update_un_pw');
    }
}

I dumped the user session data to verify that I tested with logged in users and guests.

       
OutofControl's avatar
OutofControl
164 posts
14 years ago
OutofControl's avatar OutofControl

Hi Erik,

Thanks for the reply! Knowing it should work, I rechecked my module only to find I was jumping ship in the constructor if no Member_ID was present. I modified the code accordingly and all works fine now.

Thanks for the help.

  • James
       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
14 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team

Excellent. Glad you got it sorted

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.