Go to Menus -> Menu manager -> Add New Menu. Try to save. Error console shows "TypeError: a is undefined". Maybe it's related to GSoC pulls?
(this is a copy of http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33443&start=0)
I have recorded a video adding the menu: http://www.youtube.com/watch?v=67USvsq7aZY
However I noticed that the information is not populated in case of failure when saving form.
Hi Javier,
No, 3.3-dev as noted in the report, that's why I mentioned latest GSoC pull requests which removed mootools dependancy, perhaps it's something to do with them?
I noticed something weird with the JS too on one of my extensions, none of
the toolbar buttons worked.
On Tuesday, March 11, 2014, Marko D notifications@github.com wrote:
Hi Javier,
No, 3.3-dev as noted in the report, that's why I mentioned latest GSoC
pull requests which removed mootools dependancy, perhaps it's something to
do with them?Reply to this email directly or view it on GitHub#3278 (comment)
.
Can you check if core.js is loaded? I think that one is used for the buttons. Till now this was loaded together with Mootools, and if we now have views where Mootools isn't loaded anymore, then core.js would be missing as well.
That's why I proposed to introduce JHtmlBehavior::core() to load core.js and we would have to add this to all views who need it.
It's loaded. Here is the list of loaded js:
<script type="text/javascript" src="/joomla3.3/media/jui/js/jquery.min.js">
<script type="text/javascript" src="/joomla3.3/media/jui/js/jquery-noconflict.js">
<script type="text/javascript" src="/joomla3.3/media/jui/js/jquery-migrate.min.js">
<script type="text/javascript" src="/joomla3.3/media/system/js/tabs-state.js">
<script type="text/javascript" src="/joomla3.3/media/system/js/mootools-core.js">
<script type="text/javascript" src="/joomla3.3/media/system/js/core.js">
<script type="text/javascript" src="/joomla3.3/media/system/js/punycode.js">
<script type="text/javascript" src="/joomla3.3/media/system/js/validate.js">
<script type="text/javascript" src="/joomla3.3/media/jui/js/chosen.jquery.min.js">
<script type="text/javascript" src="/joomla3.3/media/jui/js/bootstrap.min.js">
<script type="text/javascript" src="/joomla3.3/media/system/js/html5fallback.js">
<script type="text/javascript" src="templates/isis/js/template.js?f87a670b452f75b4c21c8ebe98fa697c">
And two inline, one for activating chosen and tooltip, the other
(function() {
var strings = {"JLIB_FORM_FIELD_INVALID":"Invalid field: "};
if (typeof Joomla == 'undefined') {
Joomla = {};
Joomla.JText = strings;
}
else {
Joomla.JText.load(strings);
}
})();
hmm. I tried to reproduce it but it worked for me with my test server.
Hmm, I can try to install nightly again. I tried in two browsers before submitting the bug though, both cache free.
Still present, I tried all main browsers.
Ah sorry, got it now. It's creating a menu, not a menu item like I tried.
Looks like this line is wrong: https://github.com/joomla/joomla-cms/blob/3.3-dev/media/system/js/validate-uncompressed.js#L101$(form).data('inputfields')
returns undefined when I echo it into console. Thus the $.each()
fails afterwards.
Any JS people around?
@AshanFernando can you have a look?
I was about to comment the same, I just came to it :)
The $ is local to that function and thus will most likely not work in the console. As far as I can see, the script currently is a mess of mootools and jquery code.
The $ is local to that function and thus will most likely not work in the console.
That's not the issue. I used console()
in the source code which always works.
console.log(jQuery(form).data('inputfields'));
gives undefined
. Which I believe is the basic issue.
The next error I get is "Cannot read property 'length' of undefined" from jQuery.each
I'm not familiar with JS nor jQuery to know what it's supposed to do here.
Anyone have any suggestions on a solution here?
Yes, but I am not sure if it's a real solution. The problem comes from
// Attach to forms with class 'form-validate'
$('form.form-validate').each(function() {
attachToForm(this);
}, this);
When adding menus, there is no form with that class, instead it has form-horizontal class. If I would add that class as well to edit.php in administrator\components\com_menus\views\menu\tmpl, then it would work fine.
I don't know if the solution is to call attachToForm on any form regardless of the class (maybe that's why your toolbars broke?), or to edit the layout. If before there was no dependancy on the form class, I guess it should be removed and the call should be $('form').each(function() {
. But if someone knows better how this worked, they should speak up, I am guessing
Well, the validator is supposed to be opt-in from my understanding. So, having the check for form-validate
isn't a bad thing, but inputfields
needs to be set on the form object no matter what. It's a B/C break in ways to now require the form-validate
class, so this needs to be resolved.
Or the JS needs to check if inputfields
is defined before it tries to process further. That would probably work as well.
test ok here!
please comment in the PR. If that PR does not solve the issue, we might open a new PR and then don't have to guess which "test ok" is for which PR.
Ok, did
PR is now committed
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-03-28 15:38:49 |
Labels |
Added:
?
Removed: ? ? |
Thanks for reporting @chivitli
Do you mean in version 3.2.3. isn't it?
I have just tested with a 3.2.3 and I can't reproduce. Can you share more details about what you did in the New Menu Screen to get this error?