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

bug with wysiwyg field named "head" #273

Open
cvlmtg opened this issue Feb 1, 2015 · 7 comments · May be fixed by #278
Open

bug with wysiwyg field named "head" #273

cvlmtg opened this issue Feb 1, 2015 · 7 comments · May be fixed by #278
Labels

Comments

@cvlmtg
Copy link

cvlmtg commented Feb 1, 2015

this is what happens when you edit an entity that have a field named "head":

schermata 2015-02-01 alle 17 21 05

instead of the content of that field you see that snippet of code. in show view you don't see anything but get lots of errors in the js console, like this one:

 TypeError: undefined is not a function
    at a.$inject (http://localhost:3000/public/vendor/ng-admin/ng-admin.min.js:4:5623)
    at http://localhost:3000/public/components/angular/angular.min.js:194:11
    at l.$get.xa.(anonymous function) [as value] (http://localhost:3000/public/components/angular/angular.min.js:59:175)
    at hb.functionCall (http://localhost:3000/public/components/angular/angular.min.js:198:426)
    at Object.<anonymous> (http://localhost:3000/public/components/angular/angular.min.js:108:188)
    at l.$get.l.$digest (http://localhost:3000/public/components/angular/angular.min.js:123:401)
    at l.$get.l.$apply (http://localhost:3000/public/components/angular/angular.min.js:126:471)
    at http://localhost:3000/public/components/angular/angular.min.js:139:187
    at e (http://localhost:3000/public/components/angular/angular.min.js:40:339)
    at http://localhost:3000/public/components/angular/angular.min.js:44:375
TypeError: Cannot read property 'replace' of undefined
    at a.$inject (http://localhost:3000/public/vendor/ng-admin/ng-admin.min.js:4:5622)
    at http://localhost:3000/public/components/angular/angular.min.js:194:11
    at l.$get.xa.(anonymous function) [as value] (http://localhost:3000/public/components/angular/angular.min.js:59:175)
    at hb.functionCall (http://localhost:3000/public/components/angular/angular.min.js:198:426)
    at Object.<anonymous> (http://localhost:3000/public/components/angular/angular.min.js:108:188)
    at l.$get.l.$digest (http://localhost:3000/public/components/angular/angular.min.js:123:401)
    at l.$get.l.$apply (http://localhost:3000/public/components/angular/angular.min.js:126:471)
    at http://localhost:3000/public/components/angular/angular.min.js:139:187
    at e (http://localhost:3000/public/components/angular/angular.min.js:40:339)
    at http://localhost:3000/public/components/angular/angular.min.js:44:375
@fzaninotto
Copy link
Member

Yep, I can reproduce it, although with a different error message. The error seems to come from textAngular, a dependency used by ng-admin.

Would you mind opening an issue in their GitHub repo?

@cvlmtg
Copy link
Author

cvlmtg commented Feb 2, 2015

ok. btw I'm playing a bit with a custom directive, and I noticed that in the link function, the scope.entry.values objects doesn't contain just the entity values, but a lots of methods, including (guess what :) a method named "head". is this supposed to be correct?

schermata 2015-02-02 alle 23 05 36

@fzaninotto
Copy link
Member

You're right, there is something wrong. It's like values gets a copy of the Restangular object... I'll dig deeper.

@cvlmtg
Copy link
Author

cvlmtg commented Feb 2, 2015

thanks :)

@jeromemacias
Copy link
Contributor

@fzaninotto Isn't be fixed with marmelab/admin-config#20 ?

@fzaninotto
Copy link
Member

I don't see how. Restangular erases data before we can read it.

@jpetitcolas
Copy link
Contributor

On last master version, this bug doesn't seem to happen anymore. Yet, an error is displayed in the console:

angular.min.js:108 TypeError: safe.match is not a function
    at taSanitize (textAngular.js:398)
    at Array._sanitize (textAngular.js:1286)
    at angular.min.js:271
    at n.$digest (angular.min.js:132)
    at angular.min.js:135
    at e (angular.min.js:43)
    at angular.min.js:46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants