Bugs

Database error -- Zoop 1.5

I wrote my code this way:

$this->addComponent('db');

in zones/default.php

function pageDefault($inPath)
{
$rs = sql_fetch_assoc("select * from my_table_name");
echo $rs;
}

My database type is Mysql. An error occurs: "Call to undefined method PDO::getAssoc()"

But I tried the "$rs = sql_fetch_rows("select....")" , it works good.

What the error mean?

Guicontrols and redirects

Hi!

There is a bug when using guicontrols with ajax functionality and as far as I know, it is not solved in 1.5

Replicate it like this:
Build a form, any form, but make sure you have a validation rule that you can break. (e.g. an input that must not be left empty)

Make a call in the same page using ajax. Then submit the form, but do not fill in the required field.

Instead of taking you back to the form, you will reach the URL that you've requested with ajax.
(the same if you access any other page within a zone - just open up another tab BEFORE you submit the invalid form).

Zoop 1.5 - Live Error handler broken

The live Error Handler in Zoop 1.5 in error.php crashes when trying to process the $sGlobals variable if $sGlobals contains objects or classes. On line 234 the foreach loop assumes each value it gets will be a string, but this is not always true in my apps. When it gets to {$value} the error handler crashes and never writes the log file. The simple fix is listed below, but this took me a couple hours to figure out since it cannot output the error. I will check this into the Zoop 1.5 branch.

foreach ($values as $name => $value)
{
	if(is_string($value)) {

GetPostIsset - Zoop 1.5.0 - Behavior Changed from 1.3

In GetPostUtils in Zoop 1.5.0 there is a difference in how the function works compared to Zoop 1.3. In 1.3 the function just checks to see if the variable is set in the Global post variable, but in 1.5 the behavior is based on the findPostItem function. This causes an issue with variables that have a empty string value.

Take for example if you submit a variable called "test" with an empty string for the value so the post data would be "test=". In Zoop 1.3 this would be set, but in Zoop 1.5 this variable would be considered unset. Was this intended?

 

Installation problem with 1.5

After getting past the LOG_FILE definition error mentioned elsewhere, I found that this line in xmlrpcClasses.php was failing:

include_once("XML/RPC.php");

After looking around a bit for a likely file that this was trying to reference, I found that if I comment the line out, the problem 'goes away' and the skeleton app loads successfully.

Oracle basic support

Hi:

I included some fixes on my zoop downloaded code in order to use Oracle (in my case 10g XE version). I must note that this fixes are not a complete support of Oracle DBs, it's just a start.

Fix 1: Get table info functionality
I extended function database::get_table_info on file db/PDO_database.php:


function get_table_info($table)
{
//FIX: extended to support Oracle
if ($this->db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql')
{
//echo "Running on mysql; doing something mysql specific here\n";
$a = $this->getAll("describe $table");

Even rows not rendered with default css class "even"

Even rows not rendered with default css class "even"
In order to fix this bug, it's necessary reset var $rclass on the render loop.

Location
File: gui/plugins/function.forms_list.php
Line: ~174

Result code:

//FIX:
$rclass = NULL;

if(isset($form->tables->$table->rowclasses))
{
$classField = $form->tables->$table->rowclasses['field'];
if(isset($form->tables->$table->rowclasses['classes'][$record->values[$classField]->value]))
$rclass = $form->tables->$table->rowclasses['classes'][$record->values[$classField]->value];
}

if(!isset($rclass))
if ($j % 2 == 0)

After instalations... some errors

Deprecated: Assigning the return value of new by reference is deprecated in G:\Projectos\www\mySite\includes.php on line 10

Deprecated: Assigning the return value of new by reference is deprecated in G:\Projectos\www\zoop\zoop.php on line 120

Fatal error: Call to undefined function define_once() in G:\Projectos\www\zoop\app\defaultConstants.php on line 2

After instalation error parser error in config.php

Hi,

after instalation and configuration, when run.. i got some errors. one of them is parser error in config.php in line 26.

define("LOG_FILE", app_dir . DIRECTORY_SEPARATOR ".." . DIRECTORY_SEPARATOR . "log" . DIRECTORY_SEPARATOR . "errors.log.html");

there is a dot missing after the first DIRECTORY_SEPARATOR

should be like this:

define("LOG_FILE", app_dir . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "log" . DIRECTORY_SEPARATOR . "errors.log.html");

PHP Bug Fix CONTENT_TYPE cause $_POST to be empty

This is a PHP bug, but you can fix it with Zoop so this might have to go into the TIPs and Tricks instead.

When you send a CONTENT_TYPE header to PHP that PHP does not understand, example 'application/x-json', using a HTTP POST request, PHP does not add set $_POST variable. This topic is pretty common when I searched Google and the bug presents itself when every you use any number of different content type headers. The fix is to manually process the php://input stream into $_POST which can be implemented very easily in Zoop.