[SOLVED] Blank ‘Create New’ windows

Archived from the Xataface Developers forum.

gthorne — Tue Jul 24, 2012 4:02 pm

I’m getting some sort of weird error on both of my XF installs. I’m not sure which data is needed, or when it started.

On the ‘select’ drop-downs, when I click ‘other’, I just get a blank pop-up window with no fields to fill in. This worked until recently. I’m not entirely sure what the last thing I changed was.

I have two XF installs on this server, in two different directories. One I have been coding with for about a week, and one is a new install from the tarball that I did just a few hours ago. I’ve made this into two separate sites, in two separate directories. In both apps, the window is blank for all select lists.

These are the only ini files that I’ve created on the new app:

Fields.ini:

Code: Select all
`[type_id]
widget:label = “Event Type”
widget:type = “select”
vocabulary = type_list

[vendor_id]
widget:label = “Vendor”
widget:type = “select”
vocabulary = vendor_list

[assigned_to_id]
widget:label = “Assigned to”
widget:type = “select”
vocabulary = personnel_list

[state_id]
widget:label = “State”
widget:type = “select”
vocabulary = state_list

[submitted_date]
widget:type = “hidden”`

Valuelists.ini

Code: Select all
`[state_list]
sql = “SELECT state_id, postal_abbr FROM states ORDER BY postal_abbr”

[type_list]
sql = “SELECT type_id, maint_type FROM maint_types ORDER BY maint_type”

[vendor_list]
sql = “SELECT vendor_id, vendor_name FROM vendors ORDER BY vendor_name”

[personnel_list]
sql = “SELECT personnel_id, personnel_name FROM personnel ORDER BY personnel_name”`

I don’t see any errors in my error.log for either site.

Any ideas?


shannah — Wed Jul 25, 2012 12:08 pm

What browser are you using? Are there any javascript errors showing up?

-Steve


gthorne — Wed Jul 25, 2012 2:30 pm

Same in Safari, Chrome, and Firefox on Mac. No JS errors, but two warnings in the Firebug console:

Code: Select all
`- Use of getAttributeNode() is deprecated. Use getAttribute() instead.
http://isocal.zayoncc.com/index.php?-action=new&-table=iso_calendar
Line 0
  • Use of attributes’ specified attribute is deprecated. It always returns true.
    http://isocal.zayoncc.com/index.php?-action=new&-table=iso_calendar
    Line 0`

gthorne — Mon Jul 30, 2012 7:27 am

Could I get this moved to ‘Xataface Users’ for more visibility?


shannah — Mon Jul 30, 2012 10:53 am

Try putting some intentional errors in your code and see if they show up in the error.log file. If they don’t then you need to find out where the errors are being written.

-Steve


gthorne — Mon Jul 30, 2012 12:18 pm

Added a call to no_such_function into the directory’s index.php. Here’s the error log:

Code: Select all
[Mon Jul 30 14:18:01 2012] [error] [client 10.200.6.105] PHP Fatal error:  Call to undefined function no_such_function() in /var/www/html/ncctool/index.php on line 22 [Mon Jul 30 14:18:06 2012] [error] [client 10.200.6.105] PHP Fatal error:  Call to undefined function no_such_function() in /var/www/html/ncctool/index.php on line 22

Still no errors in the log when I launch the ‘create new record’ window.


gthorne — Mon Jul 30, 2012 12:24 pm

Could you tell me how/where these fields are generated? It may be something I could track down with some debugging statements.


gthorne — Mon Jul 30, 2012 1:43 pm

Not sure if this helps, but when I click ‘OK’ on the (blank) window, I get this error in the Firebug console:

Code: Select all
data is undefined http://ncctool.zayoncc.com/index.php?-action=new&-table=device_info Line 549

Here’s the offending line:

Code: Select all
var key = data[keyfld];

shannah — Mon Jul 30, 2012 2:00 pm

I must misunderstand what you mean by “blank window”. There was an “OK” button in the blank window? Was there anything else?


gthorne — Mon Jul 30, 2012 2:22 pm

It has the standard title bar, and OK button. Here’s a screenshot.


shannah — Mon Jul 30, 2012 2:50 pm

Does it work if you access the new record form of the states table directly?


gthorne — Mon Jul 30, 2012 2:57 pm

Yes. I had the ‘states’ tab hidden by commenting it out in the conf.ini (I don’t expect my users to add new states that often), but I re-enabled it. I’m able to add a state in the ‘states’ tab, but the ‘Other..’ window still doesn’t work in for the dropdowns in the other tables.

The ‘states’ is just one example of this. None of the ‘Other..’ options are working for any table on either application. Different XF installs, different directories, same server.


gthorne — Wed Aug 01, 2012 1:28 pm

Just to keep this moving, here’s the relevant entries from fields.ini:

Code: Select all
[state_id] widget:label="State" widget:type = select vocabulary = state_list ;widget:editvalues = 0

and valuelists.ini:

Code: Select all
[state_list] __sql__ = "SELECT state_id, postal_abbr FROM states ORDER BY state_name"

gthorne — Wed Aug 01, 2012 3:31 pm

Ok, I think my environment variables could be getting messed up somewhere, running two instances of XF on one server. I added this code to head_slot.html:

Code: Select all
<!-- DATAFACE_PATH: {$ENV.DATAFACE_PATH} DATAFACE_URL: {$ENV.DATAFACE_URL} DATAFACE_SITE_PATH: {$ENV.DATAFACE_SITE_PATH} DATAFACE_SITE_URL: {$ENV.DATAFACE_SITE_URL} DATAFACE_SITE_HREF: {$ENV.DATAFACE_SITE_HREF} -->

And ended up with this:

Code: Select all
<!-- DATAFACE_PATH: /var/www/html/xf-iso DATAFACE_URL: http://servername.mysite.com/xf-iso DATAFACE_SITE_PATH: /var/www/html/isocal DATAFACE_SITE_URL: DATAFACE_SITE_HREF: /index.php -->

(NOTE: I changed the server name in DATAFACE_URL above)

Does this look related? What is the proper way to use XF twice on one server?


gthorne — Thu Aug 02, 2012 2:35 pm

Ok, I’m not a bright man. I figured out the issue, I’m just not sure how to solve it.

The issue wasn’t with the multiple installs, the issue was with the URL’s. I have the app in directories like this:
http://myapp.com/dirname

And I have them set up in a subdomain like this:
http://dirname.myapp.com/

The ‘create new’ windows work with the first url, but not the second.

How do I go about fixing this?


shannah — Mon Jul 30, 2012 2:50 pm

Does it work if you access the new record form of the states table directly?


gthorne — Mon Jul 30, 2012 2:57 pm

Yes. I had the ‘states’ tab hidden by commenting it out in the conf.ini (I don’t expect my users to add new states that often), but I re-enabled it. I’m able to add a state in the ‘states’ tab, but the ‘Other..’ window still doesn’t work in for the dropdowns in the other tables.

The ‘states’ is just one example of this. None of the ‘Other..’ options are working for any table on either application. Different XF installs, different directories, same server.


gthorne — Wed Aug 01, 2012 1:28 pm

Just to keep this moving, here’s the relevant entries from fields.ini:

Code: Select all
[state_id] widget:label="State" widget:type = select vocabulary = state_list ;widget:editvalues = 0

and valuelists.ini:

Code: Select all
[state_list] __sql__ = "SELECT state_id, postal_abbr FROM states ORDER BY state_name"

gthorne — Wed Aug 01, 2012 3:31 pm

Ok, I think my environment variables could be getting messed up somewhere, running two instances of XF on one server. I added this code to head_slot.html:

Code: Select all
<!-- DATAFACE_PATH: {$ENV.DATAFACE_PATH} DATAFACE_URL: {$ENV.DATAFACE_URL} DATAFACE_SITE_PATH: {$ENV.DATAFACE_SITE_PATH} DATAFACE_SITE_URL: {$ENV.DATAFACE_SITE_URL} DATAFACE_SITE_HREF: {$ENV.DATAFACE_SITE_HREF} -->

And ended up with this:

Code: Select all
<!-- DATAFACE_PATH: /var/www/html/xf-iso DATAFACE_URL: http://servername.mysite.com/xf-iso DATAFACE_SITE_PATH: /var/www/html/isocal DATAFACE_SITE_URL: DATAFACE_SITE_HREF: /index.php -->

(NOTE: I changed the server name in DATAFACE_URL above)

Does this look related? What is the proper way to use XF twice on one server?


gthorne — Thu Aug 02, 2012 2:35 pm

Ok, I’m not a bright man. I figured out the issue, I’m just not sure how to solve it.

The issue wasn’t with the multiple installs, the issue was with the URL’s. I have the app in directories like this:
http://myapp.com/dirname

And I have them set up in a subdomain like this:
http://dirname.myapp.com/

The ‘create new’ windows work with the first url, but not the second.

How do I go about fixing this?


shannah — Fri Aug 03, 2012 1:16 pm

Not sure I fully understand. In what circumstances do you access your app from http://myapp.com/dirname and in what circumstances do you access it from http://dirname.myapp.com/?
-Steve


gthorne — Fri Aug 03, 2012 1:26 pm

Ultimately, I’d like to always reference it as dirname.myapp.com, but am accessing it the other way until I can get this issue figured out.

The subdomain is set up as a virtualhost in httpd.conf. Here’s the entry:

Code: Select all
<VirtualHost *:80>     ServerAdmin webmaster@myapp.com     DocumentRoot /var/www/html/myapp     Options All +ExecCGI FollowSymLinks     DirectoryIndex index.cgi index.php index.html index.hml index.phtml index.shtml     ServerName dirname.myapp.com     ErrorLog logs/dirname.myapp.com-error_log     CustomLog logs/dirname.myapp.com-access_log common </VirtualHost>

shannah — Fri Aug 03, 2012 1:35 pm

It could be a browser security feature that is causing this. The internal window is loaded in an iframe. If you try to load content into the iframe that came from a different domain than the parent window, the browser could have stepped in to stop you. Usually this will produce some sort of javascript error in the javascript error log though.


gthorne — Fri Aug 03, 2012 1:52 pm

Is there anywhere in the URI that I should look, or any actions that I can modify to provide some debug information?


gthorne — Fri Aug 03, 2012 3:29 pm

Comparing them in Firebug side-by-side, it doesn’t look like the broken one ever does the ‘GET’ call. The working one shows this:

Code: Select all
Location: http://myapp.com/xf-iso/js/RecordDialog/templates/dialog.html Response body: <iframe class="xf-RecordDialog-iframe" width="100%" height="100%"></iframe>

No such call in the broken version.


shannah — Fri Aug 03, 2012 4:39 pm

Ok . I think I see the problem. It is the 2nd parameter of the df_init() call in your index.php file. It likely includes the full URL to the xataface install. Change this to be a relative URL.

Steve


gthorne — Mon Aug 06, 2012 10:20 am

That breaks the CSS and JS in the header, since its relative to http://dirname.myapp.com/. Xataface is installed in http://myapp.com/xf/.


gthorne — Mon Aug 06, 2012 12:45 pm

Ok, moved the xf directory under the application directory. I think that fixed it.


shannah — Fri Aug 03, 2012 4:39 pm

Ok . I think I see the problem. It is the 2nd parameter of the df_init() call in your index.php file. It likely includes the full URL to the xataface install. Change this to be a relative URL.

Steve


gthorne — Mon Aug 06, 2012 10:20 am

That breaks the CSS and JS in the header, since its relative to http://dirname.myapp.com/. Xataface is installed in http://myapp.com/xf/.


gthorne — Mon Aug 06, 2012 12:45 pm

Ok, moved the xf directory under the application directory. I think that fixed it.