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 131517 - Strange error "Unknown property PHP_CODE"
Summary: Strange error "Unknown property PHP_CODE"
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker with 1 vote (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-29 12:05 UTC by carentrica
Modified: 2008-09-03 17:36 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screen shot of error (115.92 KB, image/jpeg)
2008-03-29 12:06 UTC, carentrica
Details
The offending PHP document (3.97 KB, text/html)
2008-04-08 11:07 UTC, carentrica
Details
Screen shot of style attribute highlight problem (146.11 KB, image/jpeg)
2008-06-02 18:23 UTC, carentrica
Details

Note You need to log in before you can comment on or make changes to this bug.
Description carentrica 2008-03-29 12:05:49 UTC
Loaded an existing PHP project. Opened a PHP source file and got a very strange error:
'Encountered " "}" "}"" at line 19, column 1.
Was expecting one of:
<S>...
":"...

Unknown property PHP_CODE'

This error is shown against line 103 !!!
Comment 1 carentrica 2008-03-29 12:06:50 UTC
Created attachment 59342 [details]
Screen shot of error
Comment 2 carentrica 2008-04-08 11:07:13 UTC
Created attachment 59819 [details]
The offending PHP document
Comment 3 Tomas Mysik 2008-04-10 10:16:36 UTC
Please evaluate, thanks.
Comment 4 Petr Pisl 2008-04-10 10:46:25 UTC
Marek, could you evaluate this?
Comment 5 carentrica 2008-04-15 14:16:03 UTC
This seems only to happen when php code is embedded in the style attribute as in:-

     <html>
       <head>
       <title></title>
       </head>
     <body> 
     <?php
       $style = 'margin-top:50px';
     ?>        
(!)      <p style="<?php echo $style ?>">The boy stood on the burning deck...</p>   
     </body>
     </html>

In this instance the it is saying the error is at line 3, column 1 (?)
Comment 6 Marek Fukala 2008-04-15 14:34:38 UTC
This is know issue, problem is in css virtual source generation. In fact it is duplicate of  issue 132866 but I'll keep
it open so I do not forget to fix the php version of the model css generator.
Comment 7 Jiri Prox 2008-04-25 13:09:43 UTC
The number of next version is already known -> moving from TM Dev to 6.5
Comment 8 Marek Fukala 2008-05-14 10:26:34 UTC
already fixed
Comment 9 Marek Fukala 2008-05-14 10:26:54 UTC
oops, not fixed
Comment 10 carentrica 2008-06-02 18:13:08 UTC
Another problem with the style attribute I've noticed in a very recent dev build. This may have been in for a while as 
I haven't used PHP for a couple of weeks.

The first 8 characters of the style attribute are bold, the remainder is normal weight. See screen shot (admin.php - 
already uploaded).
Comment 11 carentrica 2008-06-02 18:23:20 UTC
Created attachment 62277 [details]
Screen shot of style attribute highlight problem
Comment 12 Marek Fukala 2008-08-11 14:55:03 UTC
The style attribute problem (benning of the value in bold blue font) has already been fixed.

As for the original problem - syntax error reported at the place of php code inside style attribute value - the
generated css virtual source contains unparsable text:

"
 SELECTOR {
	PHP_CODE
}
"

Some level of virtual source sanitization like done for JSPs is needed here. I'll try to use the same solution as for
JSP here.
Comment 13 Petr Pisl 2008-08-15 09:57:10 UTC
I obtained more complains about this from more users. As carentica wrote, the problem is in style attribute. 

<div class="infmnu" style="height:<?php echo "{$bodyh}px" ?>;">

Comment 14 Petr Pisl 2008-08-15 10:34:39 UTC
Because this issue is very visible and we have more complains about this, I'm increasing priority to P2.
Comment 15 Petr Jiricka 2008-08-26 15:20:10 UTC
BTW, could there be an analogous problem for Ruby (RHTML/ERb) and Groovy Server Pages (GSP)?
Comment 16 Marek Fukala 2008-08-26 15:26:03 UTC
sure, for all templating languages. I'll try to make the solution as less as possible temp. lang. specific. An obstacle
may be existence of multiple implementations of the css model provider.  
Comment 17 Marek Fukala 2008-09-02 13:55:57 UTC
fixed, the fix applies for all templ. languages: jsp, gsp, php, rhtml

changeset:   98984:a09913c4af2b
tag:         tip
user:        Marek Fukala <mfukala@netbeans.org>
date:        Tue Sep 02 14:52:32 2008 +0200
summary:     #131517 - Strange error "Unknown property PHP_CODE"
Comment 18 Quality Engineering 2008-09-03 17:36:20 UTC
Integrated into 'main-golden', will be available in build *200809031401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/a09913c4af2b
User: Marek Fukala <mfukala@netbeans.org>
Log: #131517 - Strange error "Unknown property PHP_CODE"