This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 233066 - JS errors caused by templating
Summary: JS errors caused by templating
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC All
: P2 normal with 1 vote (vote)
Assignee: Petr Hejl
URL:
Keywords: UMBRELLA
: 225036 225908 226567 226714 235822 (view as bug list)
Depends on:
Blocks: 166694 226126 228344 228449 229125 229280 232197 232946 232999
  Show dependency tree
 
Reported: 2013-07-19 12:15 UTC by Petr Hejl
Modified: 2013-10-29 12:48 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
short example of html template with inline css (47 bytes, text/html)
2013-08-28 14:04 UTC, zaleks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2013-07-19 12:15:28 UTC
It seems people do complain about error badges in JS when these are actually not observable in runtime due to templating/embedding. This should be handled in a better way.

Step 1) disable error badging on files in embedded case as it used to be and as it is for html, jsp and perhaps others.
Step 2) provide a mechanism (perhaps similar to html) to disable errors on files completely
Comment 1 Petr Hejl 2013-07-19 12:34:19 UTC
*** Bug 226714 has been marked as a duplicate of this bug. ***
Comment 2 Petr Hejl 2013-07-19 12:36:20 UTC
*** Bug 225908 has been marked as a duplicate of this bug. ***
Comment 3 Petr Hejl 2013-07-19 13:43:17 UTC
Step 1) fixed in web-main f3de0a1c95ae
Comment 4 qazzi76 2013-07-19 16:46:20 UTC
Hi Petr,

If Step 1 is fixed how can I test it?

Also what build will the fix be available in?

This issue has been driving me crazy...
Comment 5 Petr Hejl 2013-07-19 19:33:31 UTC
(In reply to comment #4)
> If Step 1 is fixed how can I test it?
> 
> Also what build will the fix be available in?
The integration message should appear here once it is available in daily build. It usually takes a day or so.
Comment 6 Quality Engineering 2013-07-20 02:11:59 UTC
Integrated into 'main-silver', will be available in build *201307192300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f3de0a1c95ae
User: Petr Hejl <phejl@netbeans.org>
Log: #233066 - JS errors caused by templating
Comment 7 Petr Hejl 2013-07-24 12:55:11 UTC
web-main branch javascript-errorchecking ff8cd4784d8d

This contains a minor change in HTML api thus it is in a branch waiting for Marek's approval.

I have to do some more changes in JS itself.
Comment 8 Petr Hejl 2013-07-25 08:55:07 UTC
Error hints implemented.
web-main branch javascript-errorchecking d93284321e25
Comment 9 Marek Fukala 2013-07-25 09:03:10 UTC
The change looks OK. Would be nice if we share the copy pasted code somehow. Some kind of generic API for handling such errors would be very nice.
Comment 10 Petr Hejl 2013-07-25 09:08:29 UTC
Merged to trunk 14137839278f. I'm going to close related P3. I'll also file a task for shared api.
Comment 11 Petr Hejl 2013-07-25 09:13:07 UTC
(In reply to comment #9)
> Some kind of generic API for handling such errors would be very nice.
Filed as #233389.
Comment 12 Quality Engineering 2013-07-26 02:50:03 UTC
Integrated into 'main-silver', will be available in build *201307252300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ff8cd4784d8d
User: Petr Hejl <phejl@netbeans.org>
Log: #233066 - JS errors caused by templating
Comment 13 Petr Hejl 2013-08-22 08:39:39 UTC
*** Bug 226567 has been marked as a duplicate of this bug. ***
Comment 14 zaleks 2013-08-27 16:34:42 UTC
You've written that 1) is fixed. I've installed the latest build (201308270854) and I'm still observing theese nasty error icons on folders in project tree. Could you tell please, how can I see that problem is fixed and turn off theese icons?

Thank you.
Comment 15 Marek Fukala 2013-08-27 18:20:35 UTC
(In reply to zaleks from comment #14)
> You've written that 1) is fixed. I've installed the latest build
> (201308270854) and I'm still observing theese nasty error icons on folders
> in project tree. Could you tell please, how can I see that problem is fixed
> and turn off theese icons?
> 
> Thank you.

I'm not sure what's the status (Petr Hejl will know more), so just an idea: Did you touched all the files? You need to force them to reindex by changing their timestamps. Then the error badged will be updated as well. 

Or you can start netbeans w/ a new userdir or delete the cache directory in the userdir instead of the touching the files.
Comment 16 zaleks 2013-08-28 09:01:57 UTC
(In reply to Marek Fukala from comment #15)

Thank you, but it didnt work
1) I tried to edit and save file and nothing changed.
2) I've removed cachedir and after reindexing badges appeared again.
Comment 17 Petr Hejl 2013-08-28 09:17:50 UTC
(In reply to zaleks from comment #16)
> (In reply to Marek Fukala from comment #15)
> 
> Thank you, but it didnt work
> 1) I tried to edit and save file and nothing changed.
> 2) I've removed cachedir and after reindexing badges appeared again.

The fix for this issue apply only to JS embedded in other language such as HTML/PHP. If you have plain old js file the badges are there.
Comment 18 zaleks 2013-08-28 09:27:30 UTC
> The fix for this issue apply only to JS embedded in other language such as
> HTML/PHP. If you have plain old js file the badges are there.

I understand this. I have no problems with plain js files, problem is in JS, embedded into html-template file using '{' and '}' for templating purposes.
Comment 19 Petr Hejl 2013-08-28 09:44:00 UTC
(In reply to zaleks from comment #18)
> > The fix for this issue apply only to JS embedded in other language such as
> > HTML/PHP. If you have plain old js file the badges are there.
> 
> I understand this. I have no problems with plain js files, problem is in JS,
> embedded into html-template file using '{' and '}' for templating purposes.

Please share a sample file with us. Thanks.
Comment 20 zaleks 2013-08-28 10:47:07 UTC
> Please share a sample file with us. Thanks.

I'm sorry. Now I can see, that problem with inline js is really fixed.
I had another problem in the same file, thats why I was confused.
Another problem is - inline css :)

Like this:

<a style="float: {S_CONTENT_FLOW_END};">...</a>

- example taken from one file of phpbb engine.

I understand, that it is bad coding-style, it will be better to use class here, but it is not my code - it is phpbb, which I'm just using in my project, and I cant fix all these inline css.

So it will be great to disable badges for inline css also, like you've done it for inline js.

Sorry for confusion.
And thank you for quick replies.
Comment 21 Marek Fukala 2013-08-28 11:36:48 UTC
Please attach the file so I can try it. The errors in embedded around a templating code should be suppressed.
Comment 22 zaleks 2013-08-28 14:04:00 UTC
Created attachment 139375 [details]
short example of html template with inline css
Comment 23 Vladimir Riha 2013-09-11 15:39:40 UTC
*** Bug 235822 has been marked as a duplicate of this bug. ***
Comment 24 Petr Hejl 2013-09-11 21:48:25 UTC
*** Bug 225036 has been marked as a duplicate of this bug. ***
Comment 25 Vladimir Riha 2013-09-27 07:15:36 UTC
*** Bug 225036 has been marked as a duplicate of this bug. ***
Comment 26 Petr Hejl 2013-09-27 14:31:56 UTC
*** Bug 225036 has been marked as a duplicate of this bug. ***
Comment 27 Petr Hejl 2013-09-27 15:53:20 UTC
*** Bug 225036 has been marked as a duplicate of this bug. ***
Comment 28 lorenthal 2013-10-29 10:49:12 UTC
Same problem here with PHP tags in inline CSS. As zaleks@netbeans.org case, I work with legacy code and I have hundreds of files affected. It worked OK in NB 7.3.1.

You can see and example here:

<div id="errbusc" style="position:absolute; left:490px; top:271px; width:251px; height:123px; z-index:10; padding:16; border: 4 #FFF7D9 solid;<? if($error == 2) echo "visibility:visible"; else echo "visibility:hidden"; ?>"> 
  Error
</div>

If I remove the PHP tags, the file is parsed correctly.
Comment 29 Vladimir Riha 2013-10-29 10:51:35 UTC
Please submit a new issue against web/css editor. Your sample is not related to JavaScript. Closing again
Comment 30 daorus 2013-10-29 12:14:03 UTC
(In reply to Vladimir Riha from comment #29)
> Please submit a new issue against web/css editor. Your sample is not related
> to JavaScript. Closing again

The problem is that our bug reports are marked as duplicates, but they are not!

Look here https://netbeans.org/bugzilla/show_bug.cgi?id=237669
Comment 31 Vladimir Riha 2013-10-29 12:48:45 UTC
OK, moving discussion to the issue 237699 so we don't spam others.