MasterVitronic / fusionpbx

Automatically exported from code.google.com/p/fusionpbx
0 stars 0 forks source link

Ring group edit and fetchall #411

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a ring group
2. edit and modify the same ring group
3.

What is the expected output? What do you see instead?

the xml in the filesystem results with a double lines:

   <condition field="destination_number" expression="^3100$" >
   <condition field="destination_number" expression="^3100$" >
       <action application="set" data="ring_group_uuid=60de7cb0-b6f9-44a2-9cf5-c8f0a604e3ad" />
       <action application="set" data="ring_group_uuid=60de7cb0-b6f9-44a2-9cf5-c8f0a604e3ad" />
       <action application="lua" data="ring_group.lua" />
       <action application="lua" data="ring_group.lua" />
   </condition>

Another problem:
        if ($ring_group_strategy == "sequence") {
                echo "  <option value='selected' selected='selected'>".$text['dropdown-sequence']."</option>\n";
        }

must be:
        if ($ring_group_strategy == "sequence") {
                echo "  <option value='sequence' selected='selected'>".$text['dropdown-sequence']."</option>\n";
        }

What version of the product are you using? On what operating system?

trunk r3953, centos 6.4, sqlite

Please provide any additional information below.

In the ring_groups_edit.php there is the following statement:
//if it does not exist in the dialplan then add it
...
    $row = $prep_statement->fetchAll(PDO::FETCH_ASSOC);

the result is a matrix (and not an array) and the condition    if 
($row['num_rows'] == 0) {   is not satisfied. Here's why there are double lines.
The problem is resolved changing to:

    $row = $prep_statement->fetch(PDO::FETCH_ASSOC);

is this a problem just with Sqlite?

Original issue reported on code.google.com by carlo.di...@gmail.com on 29 Apr 2013 at 10:53

GoogleCodeExporter commented 9 years ago
With your suggestion I have updated the following code. Seemed to work both 
ways on Postgres.
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);

echo "  <option value='select' 
selected='selected'>".$text['dropdown-sequence']."</option>\n";

This was already fixed in the dev branch but didn't make its way to stable. Dev 
branch at this moment is more stable than the 3.2. FusionPBX 3.3 release will 
be later today.

Fixed in revision 3955.

Original comment by markjcrane@gmail.com on 29 Apr 2013 at 3:08