179 Posts
carin
8 years ago
12
Topic

Hi, a year ago I made a module to display content from the cck db tables. It worked but with one of the latest updates I now get "Undefined variable: cck in line ...". Did something change in the way the $cck object is populated or do I have to call it in a specific way now? cheers

Get a VIP membership
4229 Posts
Kadministrator
8 years ago
1
Level 1

how do you populate $cck object? here is no global variable with that name so unless you are in seblod context you need to populate it yourself.

179 Posts
carin
8 years ago
0
Level 2

Ok, yes I thought I would need to populate it myself. I just dont know how. Any hint? A year ago it seamed to work without that but I am not sure.

I tried this but it does not seam to work:

if ( ! defined ( 'JPATH_LIBRARIES_CCK' ) ) {
define( 'JPATH_LIBRARIES_CCK', JPATH_SITE.'/libraries/cck' );
}
if ( ! defined ( 'JROOT_MEDIA_CCK' ) ) {
define( 'JROOT_MEDIA_CCK', JUri::root( true ).'/media/cck' );
}

4229 Posts
Kadministrator
8 years ago
0
Level 1

Perhaps this can help

179 Posts
carin
8 years ago
0
Level 1

Thanks but I dont know how that article would help me in populating the $cck object in my module. My module stopped working with the 3.8.x series. Seblod changed something in the core which hides the $cck object for the outside world. So please tell me how I get the $cck object back into my module.

This does not work either: $cck = CCK_Document::getInstance( 'html' );

4229 Posts
Kadministrator
8 years ago
1
Level 1

Hi,

we can only give you advice here, to solve custom code problems I suggest you use

http://www.seblod.com/store/services

179 Posts
carin
8 years ago
0
Level 2

This is not a "custom code problem". This is a problem caused by SEBLOD secretly changing essential core code in the 3.8.x versions. Or did you mention this change somewhere in the changelog?

And besides that I paid already a lot for your commercial extensions. Now you point to yet another payment? You want 475 € for one single line of code??? This just reveals the true nature of the SEBLOD spirit. Unfortunately I am already too deep into my project for a switch to a different cck.

4229 Posts
Kadministrator
8 years ago
1
Level 1

If you use some internal functions or variables of seblod you do it at your own risk, there are changes all the time, only part that should remain the same over versions is public part of API. But it is not clear how your code could work in any version of seblod as $cck is just a variable that is not magically populated so we can't give you an answer about its change. If you point to change of behaviour for specific function that you use to populate it, than we can give you more information.

Debugging of your custom module code is just outside of the scope of this forum, if you need a skilled developer to help you get your custom module code fixed you can use mentioned service or perhaps ask the person who wrote your module for support.

179 Posts
carin
8 years ago
0
Level 2

I understand that. So please tell me where the documentation for the public API is and maybe also how I can access the cck object.

I just double checked and there is the $cck object all over in your code. And it was in my module available prior to 3.8.x hence that object exists. I only need to know how to retrieve it from the com_cck component.

4229 Posts
Kadministrator
8 years ago
3
Level 1

General way to access cck object would be 

$cck    =  CCK_Rendering::getInstance( 'template_name' );

BUT -  $cck was never defined outside seblod scope, so it could not be magically present in you custom module. Only explanation why you now see this error is that you somehow raised error reporting level in joomla/php

179 Posts
carin
8 years ago
2
Level 2

Thanks, but now I get "Fatal error: Class 'CCK_Rendering' not found in ..." 

Where do I find your public API so I can solve it on my own?

4229 Posts
Kadministrator
8 years ago
1
Level 3

You need to load that class first. I suggest you get help with this changes from a php developer.

179 Posts
carin
8 years ago
0
Level 4

Thank you, but why do you not point me to your public API documentation that you mentioned earlier? I looked for it but could not find it on this website.

Get a VIP membership