Web Resource Problems for one file - Zend Studio 13EA

General discussion on Zend Studio

Web Resource Problems for one file - Zend Studio 13EA

Postby jaso9146 on Wed Sep 09, 2015 8:55 pm

I see a number of warnings like the following in my Problems tab for a single file in my project.

Code: Select all
Description                      Resource      Path                    Location  Type
Undefined CSS class (company).   index.phtml   /project/path/to/file   line 78   Web Resource Problem


The odd thing is that Web Resource validation seems to work fine for other project files (I can hover over class names and the CSS code for that class is displayed in the tool tip window). I tried a Project > Clean... but no changes. Am I missing something?
jaso9146
 
Posts: 29
Joined: Mon Jan 12, 2015 8:58 pm

Re: Web Resource Problems for one file - Zend Studio 13EA

Postby kaloyan_r on Tue Sep 15, 2015 12:28 pm

Is this index.html a template file? Could you provide some example code that demonstrates the problem?

You should be familiar with the Web Root Folders features that we've discussed in this topic: viewtopic.php?f=59&t=122958&p=246913#p246913
Do you use for this project?
Kaloyan Raev
Zend Studio Team
User avatar
kaloyan_r
Zend Product Manager
 
Posts: 582
Joined: Thu May 23, 2013 12:40 pm

Re: Web Resource Problems for one file - Zend Studio 13EA

Postby jaso9146 on Tue Sep 15, 2015 8:22 pm

Yes, index.phtml is a template (basically all HTML with a bit of PHP). All the other templates also use the .phtml extension and everything works with them.

Code example:
Code: Select all
<li><a class="header-link hide-select" href="javascript: false;">x</a></li>
...
<li><a href="/path" class="header-link">y</a></li>


In the first line, nothing is underlined. In the following line, the header-link class value is underlined with an "Undefined CSS class (header-link)" warning. When I hover over the non-underlined header-link class, it does not show me the class CSS. Other files in the project do show CSS snippets when I hover over the class names (including the header-link class). The CSS snippets are from files in a directory that I defined as my web root using the Web Root Folders feature so it does appear to work.
jaso9146
 
Posts: 29
Joined: Mon Jan 12, 2015 8:58 pm

Re: Web Resource Problems for one file - Zend Studio 13EA

Postby jaso9146 on Tue Sep 15, 2015 8:42 pm

I also created a trouble ticket (Request #54774) where they had me disable the following files and restart using the -clean flag:

org.eclipse.a.wst.html.webresources.core_1.0.0.201507080739.jar
org.eclipse.a.wst.html.webresources.ui_1.0.0.201507080739.jar

This got rid of the warnings in that one file but disabled validation for everything else in my project.
jaso9146
 
Posts: 29
Joined: Mon Jan 12, 2015 8:58 pm

Re: Web Resource Problems for one file - Zend Studio 13EA

Postby kaloyan_r on Thu Sep 17, 2015 4:29 pm

Jason, I cannot reproduce the problem with the code examples I create on my own. Could you provide us with a crippled version of your project that can still demonstrate the problem?
Kaloyan Raev
Zend Studio Team
User avatar
kaloyan_r
Zend Product Manager
 
Posts: 582
Joined: Thu May 23, 2013 12:40 pm

Re: Web Resource Problems for one file - Zend Studio 13EA

Postby jaso9146 on Thu Sep 17, 2015 11:00 pm

Steps to reproduce.

Open Zend Studio 13.0 Early Access
I am currently using Build ID: 13.0.0.v20150928-20150916-1359-507

Create a new Local PHP Project.
Name the project.
Leave all the default settings and click Finish.

Delete the default index.php file.

Right click your project.
Select New > Folder.
Enter "app/views/scripts/header".
Click Finish.

Right click the header directory.
Select New > File.
Enter "index.phtml".
Click Finish.

Enter the following into index.phtml:
<html>
<head>
<title>Title</title>
<link rel="stylesheet" type="text/css" href="x.css" />
</head>
<body>
<div>
<a class="color" href="/">Link</a>
</div>
</body>
</html>

Right click your project.
Select New > Folder.
Enter "www/styles".
Click Finish.

Right click the styles directory.
Select New > File.
Enter "temp.css".
Click Finish.

Enter the following into temp.css:
.color {
color: #ff0000;
}

Right click your project in the PHP Explorer tab and click Properties.
Select Web Resources > CSS.
Check the "Enable project specific settings" checkbox.
Make sure the "Search CSS id and class in all CSS files..." option is checked.
Select Web Resources > Validation > Web Root Folders.
Check the www directory.
Select Validation.
Check the "Enable project specific settings" checkbox.
Click the Settings button for the Web Resources Validator.
Select the Include Group entry and click the Add Rule button.
Select the File extension option and click Next.
Enter "phtml" and click Finish then click OK.
Click OK to close the Project Properties window

Select Project > Clean... from the menu.
Click OK.

Open the index.phtml file.
You should see one error and one warning in the Problems window.
Delete the stylesheet line and save.
The color class is still underlined as a warning but no longer shows up in the Problems window. (I'm not sure if this is a bug or not.)
Insert the following line under the <title>
<link rel="stylesheet" type="text/css" href="/styles/temp.css" />
Save the file.
The class warning should now be visible again in the Problems window.
Bug: The color class is still underlined/not identified as valid by Web Resources.
jaso9146
 
Posts: 29
Joined: Mon Jan 12, 2015 8:58 pm

Re: Web Resource Problems for one file - Zend Studio 13EA

Postby kaloyan_r on Wed Sep 23, 2015 10:05 am

Thanks for the detailed instructions!

I can now reproduce the problem and work for fixing it.
Kaloyan Raev
Zend Studio Team
User avatar
kaloyan_r
Zend Product Manager
 
Posts: 582
Joined: Thu May 23, 2013 12:40 pm

Re: Web Resource Problems for one file - Zend Studio 13EA

Postby jaso9146 on Mon Dec 28, 2015 10:40 pm

Just checking in to see if there have been any updates.
jaso9146
 
Posts: 29
Joined: Mon Jan 12, 2015 8:58 pm

Re: Web Resource Problems for one file - Zend Studio 13EA

Postby kaloyan_r on Mon Jan 04, 2016 4:00 pm

We've done some debugging. We know the root cause, but we still don't have the solution. We track the issue here: https://github.com/angelozerr/eclipse-w ... /issues/51
Kaloyan Raev
Zend Studio Team
User avatar
kaloyan_r
Zend Product Manager
 
Posts: 582
Joined: Thu May 23, 2013 12:40 pm

Re: Web Resource Problems for one file - Zend Studio 13EA

Postby jaso9146 on Tue Sep 20, 2016 7:32 pm

It does not look like the above listed ticket is going anywhere. Will this be fixed in time for Zend Studio 14?
jaso9146
 
Posts: 29
Joined: Mon Jan 12, 2015 8:58 pm

Next

Return to Zend Studio

Who is online

Users browsing this forum: No registered users and 1 guest