Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't load component cmp1 error when dynamically loading tab in workspace #76

Closed
rvwong opened this issue Mar 7, 2014 · 3 comments
Closed

Comments

@rvwong
Copy link

rvwong commented Mar 7, 2014

Environment: Ruby 2.0 Rails 4.0 netzke-core 0.90 netzke-base 0.9.0 netzke-communitypack 0.80
When trying to load a component into a tab using the netzke Workspace, I get the error "Couldn't load component cmp1" error. I tracked the error to the Netzke::Core::Composition module, specifically the deliver_component endpoint. In this method, the line of code;

'''cmp_instance = components[component_name] &&
!components[component_name][:excluded] &&
component_instance(component_name, {item_id: item_id, client_config: params[:client_config]})'''

cmp_instance should be returning a component line "UserGrid" which would be inserted into the tab, it is returning nil instead when it shouldn't.
I traced the problem further to the function call 'component_instance' that is called in that expression. I'm by no means completely familiar with Netzke code, but this where my understanding of the code is sparse. I noted that Max had made significant changes to the code for the component_instance method, as a matter of fact the code was completely replaced from the older working version. The new code seems to expect that any child components should have a method 'child component name'_component present in the parent component's code. I looked every where and cannot find where this method is dynamically inserted prior to this component_instance method being called, as a result 'component_instance' will always return nil. Just verify my theory, I monkey patched in the old code that was there before the code change, and low and behold components correctly get inserted into Workspace tabs. Can you please look into this Max? Thanks for creating Netzke btw, big fan!

@mxgrn
Copy link

mxgrn commented Mar 10, 2014

Y'day I got to extracting Workspace to a dedicated gem, making it compatible with latest Core. Plan to publish it within the next 2-4 days.

@rvwong
Copy link
Author

rvwong commented Mar 10, 2014

Ok Max, thank you for addressing this so quickly! You da man!

@mxgrn
Copy link

mxgrn commented Apr 2, 2014

Sorry it took me so long eventually, but here it is: https://github.com/netzke/netzke-workspace

It's just been released as a gem, too.

Please, let me know whether you have any troubles using it.

@mxgrn mxgrn closed this as completed Apr 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants