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

error loading library from fieldtype

Development and Programming

luke holder's avatar
luke holder
71 posts
about 16 years ago
luke holder's avatar luke holder

i am building a module and am having problems when i get to the feildtype.

I have successfully got all the mcp stuff working, as well as the tag/plugin working.

I am now up to the fieldtype.

in my mod. file and my mcp. file in both constructors i am successfully loading a library i have written from my libraries/ssp/ directory within my third_party plugins folder.

i use the following to load the library…

$params = array('api' => $this->data['api'],'url' =>$this->data['url']);
$this->EE =& get_instance();
$this->EE->load->library('ssp/DirectorPHP',$params,'Director');

I can then load the library and use its methods perfectly with this this for example:

$album = $this->EE->Director->album->get($albumid);

But when i try and do the same from my fieldtype there is a load error:

An Error Was Encountered Unable to load the requested class: directorphp

I was able to find where the error was being triggered in the core loader:

// If we got this far we were unable to find the requested class.
        // We do not issue errors if the load call failed due to a duplicate request
        if ($is_duplicate == FALSE)
        {
            log_message('error', "Unable to load the requested class: ".$class);
            show_error("Unable to load the requested class: ".$class);
        }

I am confused why the library won’t load from the fieldtype class i am creating, and will from my mcp or mod files. Like i said, i’m using the same exact class initiation method.

the only thing i can think of is the fact that the feildtype extends the EE_feildtype and this changes the location of the places it looks for the library. any info would help.

thanks

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
about 16 years ago
Pascal Kriete's avatar Pascal Kriete

Ah gee, you’re right. We’re not adding the package paths for the constructor or _init calls.

I’ll fix it up, for now you’ll need to load it in the method where you use it.

Thanks for the heads up.

       
luke holder's avatar
luke holder
71 posts
about 16 years ago
luke holder's avatar luke holder

no worries. Thanks for your attention.

To be honest I was loosing faith the support promise hype. I’m still new, and feel like quite a few of my posts have been ignored, it wasn’t until i posted a big linkbait “BUG in EE” post that i got attention, even though i was taking a punt it was even a bug. I couldn’t find any guidance in the documentation.

I know it’s still in beta, and under development, but I do believe your extension/module documentation needs to be improved, especially if you want to fix these bugs and release v2 when you plan. The effort in re-vamping and improving documentation may seem like a hassle now, but will actually make the platform and product stronger.

At the moment i feel like the writer still presumes quite a bit in the documentation, if i wasn’t already a codeigniter dev, i would be totally lost.

thanks for reading.

sincerely, Luke Holder.

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
about 16 years ago
Pascal Kriete's avatar Pascal Kriete
I’m still new, and feel like quite a few of my posts have been ignored, it wasn’t until i posted a big linkbait “BUG in EE” post that i got attention, even though i was taking a punt it was even a bug.

It was a post to the official tech support forums that got our attention. The dev team has largely had their heads down in code, so the development forums have been getting a bit neglected. I’ll try to make a point of hitting them a little more frequently.

I know it’s still in beta, and under development, but I do believe your extension/module documentation needs to be improved, especially if you want to fix these bugs and release v2 when you plan.

We absolutely agree.

At the moment i feel like the writer still presumes quite a bit in the documentation, if i wasn’t already a codeigniter dev, i would be totally lost.

Do you have anything specific that you would like to see more documentation/clarification on?

Thank you very much for the feedback. Please check the email associated with your ee.com account for a followup to the bug.

-Pascal

       

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.