Issues with contentbox-formbuilder with contentbox v5.3

I am trying to run contentbox-formbuilder intslled from forgebox with ContentBox v5.3. I think it was designed to be used with v3.0. I have fixed a couple of problems but I still have issues.

In handlers\base.cfc I have updated the dependency injection property which was using entityService and replaced it with VirtualEntityService.

The original property said inject=“entityService:Field”;
I have changed it to inject=“VirtualEntityService:Field”;

Unfortunately, there is still an issue with the creation of the Virtual Entity Services and it is saying it can’t find the entity it is using to build it. The error says “Error building: FieldService@cbFormBuilder → No entity (persistent component) with name [Field] found”.

I have also tried converting the Service to a small stub which extends VirtualEntityService.

component extends="modules.contentbox.modules.contentbox-deps.modules.cborm.models.VirtualEntityService" singleton {

	public FieldService function init(){

		// init super class
		super.init(entityName="Field");

		return this;
	}	
}

The error is similar.
The error says “Error building: FieldService@cbFormBuilder → No entity (persistent component) with name [Field] found”.

I also tried adding the following line to the ModuleConfig.cfc but it did not help:

binder.map(“Field@cbFormBuilder”).to(“#moduleMapping#.models.Field”);

Can anyone point me in the right direction please?

This module was build in 2013.
Curt uploaded to forgebox in 2017.

I don’t think it’s seen some love in a long time.
We have a couple of other custom tools we have built over time, but not released as they had too much custom stuff.
This is interesting as it uses ORM behind the scenes. Most of the recent ones I have built are all JSON representations… more like a custom content type.

I took a Quick look, to try and help on the weekend and not leave you stranded. Couple of thoughts.

Looks like EntityService should still work. I just wonder if FIELD is the name of the entity, or if it defaults to CB_ENTITY
All of the contentbox tables explicitly set an entity name… because our tables and entity names are not the same… so try with the name of the table for the entity name

inject=“EntityService:cb_field”

Also try manually adding a entityName=“field” into the definition - that might help, and then you can make a PR.

Thanks, Gavin, I will try those suggestions.

Unfortunately, I can only work on this at the weekend right now.

Kevin

Gavin,

I tried your suggestions but without any improvement. Also tried changing a few other things so that the order that things happen is different and the result is that I have come to the conclusion that for some reason the models in the “contentBox\modules\contentbox\modules_user\contentbox-formbuilder\models” directory are not being seen by wirebox. I keep getting an Error when the builder tries to construct the Virtual Service.

I have tried various combinations of changes but none can see the object that is being used as a basis for the service.

Maybe I need to manually tell wirebox that they are there?

I tried "inject=“EntityService:Field@cbFormBuilder” but got a similar message. No entity (persistent component) with name [Field@cbFormBuilder]

Perhaps I should add some sort of mapping. Unfortunately, as I am a beginner in the coldbox world I need to go away and read the manual or watch a few more videos.

The error seems to indicate that the component must be a ‘persistent component’. I see these objects all have persistent=“true” which I assume is what it means.

I will read through the wirebox manual and hopefully have some time on Wednesday to do a bit more. If you recognise what is going wrong in the meantime please let me know.

It would be great to fix this and get the module working as it solves one of my requirements and would allow our community centre users to complete a form and book a room or an event and give the admin team flexibility to add new fields depending on the event and the funding rules for the event.

Thanks again.

Kevin