Page 1 of 2

New User Errors and confusions

PostPosted: Wed Jun 22, 2011 10:26 pm
by Chris
Just keeping track of errors FYI from a new user's view.

When running installer.php

Code: Select all
Strict Standards: Non-static method Dataface_Installer::mainMenu() should not be called statically in /home/stockchase/public_html/xataface/installer.php on line 546
Xataface


Proceeding find until step 3, downloading tarball
Receive a file which is called yadda.tar.gz
have problems opening it.
File has text at the beginning.
Code: Select all
<br />
<b>Notice</b>:  Undefined variable: compression in <b>/home/stockchase/public_html/xataface/installer.php</b> on line <b>389</b><br />

'Z.0Í2tÔÎÛýSf

I modified installer to force gz compression and tried again.

Now works with gunzip and tar.

It creates minimal directory which asks for the template_c to be exposed. Which I already did in the initial install directory.

I guess installer.php wasn't what I was supposed to run.

Re: New User Errors and confusions

PostPosted: Wed Jun 22, 2011 10:34 pm
by shannah
Looks like there are some issues with the installer and PHP 5.3. You could just turn off "display errors" to get around it for now. I'll take a look at this for the next release.

You could also just do a manual install. Personally I never use the installer or the makesite script since it's so easy to just do a manual app setup (4 lines of code and a conf.ini file).

-Steve

Re: New User Errors and confusions

PostPosted: Wed Jun 22, 2011 10:49 pm
by Chris
Ok after reading a bit more documentation, using makesite.

when creating your releases shouldn't it be marked as executable (chmod +x makesite)

it works well, but doesn't create the templates_c directory. I can understand not wanting to set it 777 and making the user do it, (so the user is aware) but it would be nice for the directory to be created.

Going into the just created site, I get a bunch of
Code: Select all
Warning: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/stockchase/public_html/xataface/lib/Smarty/Smarty_Compiler.class.php on line 400

Which could be eliminated by setting the timezone to something, with a warning that it may need to be modified.
eg date_default_timezone_set('America/New_York');

Re: New User Errors and confusions

PostPosted: Wed Jun 22, 2011 10:51 pm
by Chris
I know I can get around all these items. I just though you'd like to see a new users perspective. All these things are quick fixes as far as I can see.
Great software BTW.
I'm hoping to use it to revamp http://stockchase.com

Re: New User Errors and confusions

PostPosted: Thu Jun 23, 2011 2:15 am
by Chris
I'm getting
Code: Select all
Strict Standards: Non-static method Dataface_IO::getByID() should not be called statically in /home/stockchase/stockchase.net/public_html/xataface/dataface-public-api.php on line 247


but I don't see where it's coming from. (The code looks fine to me).

Re: New User Errors and confusions

PostPosted: Thu Jun 23, 2011 5:48 pm
by shannah
This is an issue with PHP 5.3 enforcing strict standards (can't call nonstatic methods from a static context anymore etc..).

You can work around this by either turning off the display of E_STRICT warnings or simply not displaying errors to the browser.
What version of Xataface are you using. I was pretty sure that the latest had fixed this particular error.

-Steve

Re: New User Errors and confusions

PostPosted: Thu Jun 23, 2011 9:22 pm
by Chris
I just downloaded it last night so I expect it's your newest version. :)
Thing is, I'm developing on my local server with debug stuff turned on, when it's ready to go it will be on a server that I don't have control over, so I'd rather avoid things like this if possible.

I think you've gotten rid of most of them. I tried xataface about 6 months ago, and this is definitely cleaner.

BTW is it possible to put comments in the ini files.
So I can put stuff in but comment it out, and try out different combinations?

Hmm, found a problem.
Code: Select all
[Days]
Daily = Daily
Friday = Friday
Monday = Monday
None = None
Saturday = Saturday
Sunday = Sunday
Thursday = Thursday
Tuesday = Tuesday
Wednesday = Wednesday

[sendFreq]
widget:label = "Emails sent"
widget:type = select
vocabulary = Days


Guess what None evaluates to.
Warning: syntax error, unexpected BOOL_FALSE in /home/stockchase/stockchase.net/public_html/tables/emailTopPicks/fields.ini on line 5 in /home/stockchase/stockchase.net/public_html/xataface/Dataface/ConfigTool.php on line 443
and the parse seems to fail.

I guess I need to change the data in the database to accommodate this?

Re: New User Errors and confusions

PostPosted: Fri Jun 24, 2011 4:11 pm
by shannah
If your server's on PHP 5.2 then there won't be a problem. It's just 5.3 that gets its panties in a knot for this stuff. The reason these warnings are here is because until recently we were trying to keep PHP 4 compatibility. (You can't achieve both compatibility and STRICT 5.3 compliance at the same time).

Also, the error that you're talking about occurs when running the installer correct? You shouldn't need to do this in the live site.

For the "None" issue there are many workarounds.

e.g.

1. Store the valuelist in the database.
2. Define the valuelist as a delegate method (e.g. function valuelist__Days(){}).

-Steve

Re: New User Errors and confusions

PostPosted: Fri Jun 24, 2011 9:24 pm
by Chris
Actually this error [codeS]trict Standards: Non-static method Dataface_IO::getByID() should not be called statically in /home/stockchase/stockchase.net/public_html/xataface/dataface-public-api.php on line 247[/code]
Is when I'm looking at a table. I'm past the install stage at this point.

Re: New User Errors and confusions

PostPosted: Sat Jun 25, 2011 1:29 pm
by shannah
This has been fixed in svn for a while now. These warnings should be turned off by default though for any production server.

I don't really have an eta for releasing the changes in svn. There is much to do to prepare for the next release.

Steve

Re: New User Errors and confusions

PostPosted: Sat Jun 25, 2011 11:10 pm
by Chris
Is the svn version available for previewing?

I've updated my data base to have
Code: Select all
mysql> explain day;
+-------+---------+------+-----+---------+----------------+
| Field | Type    | Null | Key | Default | Extra          |
+-------+---------+------+-----+---------+----------------+
| id    | int(10) | NO   | PRI | NULL    | auto_increment |
| name  | text    | NO   |     | NULL    |                |
+-------+---------+------+-----+---------+----------------+
2 rows in set (0.00 sec)

which contains days of the week, None, and Daily as items 1 through 9.

I also have
Code: Select all
explain emailTopPicks;
+----------+-------------+------+-----+------------+-------+
| Field    | Type        | Null | Key | Default    | Extra |
+----------+-------------+------+-----+------------+-------+
| user_id  | int(10)     | NO   | PRI | 0          |       |
| lastDate | date        | YES  |     | 0000-00-00 |       |
| sendFreq | varchar(20) | YES  |     | None       |       |
| day_id   | int(10)     | YES  |     | NULL       |       |
+----------+-------------+------+-----+------------+-------+


sendFreq is the same as the day's Name which corresponds to emailTopPicks.day_id==day.id
I.E.
emailTopPicks.sendFreq == day[emailTopPicks.day_id].Name;

In the emailTopPicks table field I have
Code: Select all
[Days]
__sql__ = "select id,name from day order by name"

[day_id]
widget:type = select
vocabulary = Days


which I would expect to show the days in day_id being from the day.Name.
Instead I get
Code: Select all
   User id    LastDate    SendFreq    Day id
    2    2011-06-21    Daily    1
    354    2008-08-11    Daily    1
    59    2011-06-21    Daily    1
    355    2011-06-21    Daily    1
    357    2008-08-11    Daily    1
    356    2008-08-11    Daily    1
    361    2011-06-18    Saturday    5


Editing a record shows a drop down of Please select, and 1.

What am I doing wrong?

Re: New User Errors and confusions

PostPosted: Sun Jun 26, 2011 12:40 am
by shannah
[Days]
__sql__ = "select id,name from day order by name"

[day_id]
widget:type = select
vocabulary = Days


Is this snippet from just the fields.ini file or are you showing the contents of your valuelists.ini and fields.ini in one snippet here. The Days valuelist belongs in the valuelists.ini file.

SVN is always publicly accessible. The repository is at http://weblite.ca/svn/dataface/core/trunk

-Steve

Re: New User Errors and confusions

PostPosted: Sun Jun 26, 2011 5:06 am
by Chris
That was it. Thanks so much.

spoke too soon. That fixed the initial list of records, but when editing a single record I get
Code: Select all
Strict Standards: Non-static method Dataface_IO::getByID() should not be called statically in /home/stockchase/stockchase.net/public_html/xataface/dataface-public-api.php on line 247

Fatal error: Failed parsing SQL query on select: select id,name from day order by name . The Error was Parse error: Unexpected clause on line 1 select id,name from day order by name ^ found: "day" in /home/stockchase/stockchase.net/public_html/xataface/lib/SQL/Parser.php on line 1752


The warning should affect anything (just included it here for completeness) but I don't know where the SQL error is coming from.

I Tried the svn version and the warning is gone but the sql error still persists.

Other tables seem to work ok, so I assume that "day" is giving it problems?

Bug found (svn version)
if using a vocabulary, and the magnifying glass is used to select a filter, the filter still uses the original database id value, instead of the vocabulary values.

Re: New User Errors and confusions

PostPosted: Sun Jun 26, 2011 9:17 am
by shannah
Since day is also a function name the parser is getting confused. Wrap it in back ticks to clarify.

Steve

Re: New User Errors and confusions

PostPosted: Sun Jun 26, 2011 9:25 pm
by Chris
That fixed it.
This software is great.

thanks again.