[ContentBox 1.x DEV] Details of "no entity" error

Ok, so I’m getting confused.

When modules/contentbox/model/ui/LayoutService.cfc runs the following line:

var layout = settingService.findWhere({name=“cb_site_layout”});

The BaseORMService does this:

if( getUseQueryCaching() ){
//if we are caching, we will use find all and return an array since entityLoad does not support both unique and caching
var arEntity = findAllWhere(argumentCollection=arguments);
//if we found an entity, return it
if (arrayLen(arEntity)) {
return arEntity[1];
//else return NULL, just like entityLoad with unique would
} else {
return javaCast(“null”,0);
}
} else {
return entityLoad( arguments.entityName, arguments.criteria, true );
}

Well, getUseQueryCaching() returns false by default on a new setup apparently, and it’s trying the else:

return entityLoad( arguments.entityName, arguments.criteria, true );

In this case, arguments.entityName is “cbSetting”, and of course, there’s no model object in model called “cbSetting” to entityLoad()

So, it can’t return the cbSetting entity to get the layout from.

Any thoughts on what’s going on here? Why is it trying to do this?

I’m confused by this:

/**

  • Startup Active Layout procedures
    */
    function startupActiveLayout(){
    var layout = settingService.findWhere({name=“cb_site_layout”});
    if( !isNull(layout) ){
    // register layout interception points
    interceptorService.appendInterceptionPoints( getLayoutRecord( layout.getName() ).customInterceptionPoints );
    }
    }

The var layout = line is supposed to be getting the CFC of the active layout? I don’t see how this happens using findWhere()… ? No object is returned by this findWhere…

As of now, my problem is that I clone a fresh ContentBox, leave everything to defaults, import my SQL as I always have, but now I’m seeing the error:

“No entity (persitent component) with name [cbSetting] found, available entities are []”

Help is appreciated, the only thing that’s changed in this mix is ContentBox, I’m setting it up identically to how I have the last 10 times it has worked, paths and all.

Ok, I didn’t notice before that Setting.cfc had entityname=“cbSetting”, but still, I’m confused by what’s going on here, and why it’s looking in ROOT/model and not finding anything, instead of searching where it should. Any chance this is some mapping / path issue on my end?

yes, not sure, can you check the Application.cfc mappings

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Yeah, just figured it out.

In Application.cfc change:

cfclocation=[“model”,"/contentbox/model","/contentbox/modules"],

to:

cfclocation=[“model”,“modules”,"/contentbox/model","/contentbox/modules"],

That makes it start working on Railo again, can you make this change?

That doesn’t make sense though, since /contentbox/model is where all the entities are for contentbox. this might be a Railo bug that does not respect the per app mappings then.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

I submitted a pull.

Hmm, weird, now I’m more confused. Shouldn’t it at least be /modules/contentbox/model? Wouldn’t /contentbox/model not exist? Also, maybe Railo doesn’t see the /contentbox/model as a path? I know they had a relative path issue for cfclocation at one time…

well, /contentbox is a mapping defined before. So it is just a matter of using the mapping for the locations.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano