Giter VIP home page Giter VIP logo

atk4-addons's Issues

ModelGenerator does not work

I am trying to use agile tookit model generator. As described in the documentation I am deriving my page class from Page_ModelGenerator: My page is defined like this

<?php
class page_ModelGeneratorAre extends Page_ModelGenerator {
}

But I am getting the following error:

/volume1/web/sportin/atk4-addons/mvc/Page/ModelGenerator.php:55 [2] Missing argument 1 for Page_ModelGenerator::findModels(), called in /volume1/web/sportin/atk4-addons/mvc/Page/ModelGenerator.php on line 15 and defined
/volume1/web/sportin/atk4-addons/mvc/Page/ModelGenerator.php:55 [2] Missing argument 2 for Page_ModelGenerator::findModels(), called in /volume1/web/sportin/atk4-addons/mvc/Page/ModelGenerator.php on line 15 and defined
Application Error: Method is not defined for this object

Exception_Logic, code: 0

Additional information:

class: DB
method: getAll
arguments:
0: show tables
/volume1/web/sportin/atk4/lib/AbstractObject.php:783

highChard doesn't work

i've tried to use the example code in ui.highcharts.js, but i've received a blank page. The JS libraries are correctly acquired (i see an highchart.com link on the bottom of the blank graph).

Drilldown field don't save values on POST

atk4-addons / misc / lib / Form / Field / drilldown.php

Line 52 should be changed from

return $res+$this->drill($m);
to
return $this->value_list = $res+$this->drill($m);
otherwise $this->value_list don't get correct values set and field validation gives and error.

ref 31 is not solved still: reopen

the above code do not work also:

sql looks like this: select SQL_CALC_FOUND_ROWS name,(select name from region where region.region_id = region.id ) region,id,region_id from region order by (select name from region where region.region_id = region.id ) limit 0, 25 []

my code:

class Model_Region extends Model_Table {
public $table='region';
function init(){
parent::init();
$this->addField('name')->mandatory('true');
$this->hasOne('Region_Parent','region_id');
}
}

class Model_Region_Parent extends Model_Region {
public $alias='region_parent';
}

class page_region extends Page {
function init(){
parent::init();
$crud=$this->add('CRUD');
$model = $crud->setModel('Model_Region');
$model->debug();
if($crud->grid){
$crud->grid->addPaginator();
$crud->grid->getColumn('name')->makeSortable();
$crud->grid->getColumn('region')->makeSortable();
$crud->grid->addQuickSearch(array('region','name'));
}
}
}

AgileToolkit OAuth add-on error 500 at facebook's mobile site

Reported here:
http://stackoverflow.com/questions/16451460/agiletoolkit-oauth-add-on-error-500-at-facebooks-mobile-site

Description:

I am using the OAuth Facebook controller add-on for ATK4.

  • It works as expected when authenticating with Facebook from a regular desktop browser.
  • It works when authenticating using a mobile browser that is telling face book that it's a desktop browser.
  • It does not work when Facebook detects a mobile browser and redirects to m.facebook.com/dialog/oath.

What's more, is that it works fine for signups from mobile browsers (ie, when Facebook asks the user to give permission to the app).

The login flow stops with an Error 500 at: https://m.facebook.com/dialog/oauth?redirect_uri={my_url_encoded_landing_page_where_the_OAuth_controller_lives}&scope=email&client_id={fb_app_id}

What the hell is going on here? There isn't some difference between the Facebook mobile service and the regular one that the addon isn't taking care of, or is there?

ModelGenerator.php error

Issue by fatnjazzy
Thursday Aug 08, 2013 at 17:40 GMT
Originally opened as atk4/atk4#389


Missing argument 1 for Page_ModelGenerator::findModels(), called in C:\projects\wamp\atk4\atk4-addons\mvc\Page\ModelGenerator.php on line 15 and defined

findModels signature is:
function findModels($dir, &$models, $prefix = null);

but you call it like this:
$this->findModels();

autocomplete not working

This code

$f=$this->add('Form');
$name=$f->addField('autocomplete','name','Contact')->setModel('Contact');
$f->getElement('name')->js('change',$f->js()->submit());

Results in

Exception_Logic

Method is not defined for this object

Additional information:

class: Form_Field_autocomplete
method: allowAdd
arguments: Array ( )

Comment_cnt instead of comment_cnt

BaseException

Model field was not loaded

Additional information:

Raised by object: Object Model_Comment(elexu_forum_discussion_view_commenttree_model_comment)
id: 14
field: Comment_cnt

ATK4Addons.php - what's this?

What is this file in root of addons? I believe it's not needed because it's not implemented and not used anywhere.

model with recursive reference does not work

CRUD displays a table where region field is not visible. Create new and update works, only list is not working properly

class Model_Region extends Model_Table {
    public $entity_code='region';
    function init(){
        parent::init();
        $this->addField('name')->mandatory('true');
        $this->hasOne('Region');
    }
}

Warning! Potential security vulnerability and data loss.

addons/mvc/lib/Model/Table.php

we have method there
function dsql($instance=null,$select_mode=true,$entity_code=null)

if one wants to use $model->dsql() and then perform non-select
operation (e.g. do_delete()), false should be set as first param, as else tables are appended with table aliases and thus create illegal sql query.

$dq = $model->dsql(null, false);

now, if you previously in the model initialisation had used

$this->setMasterField($field, $value) //e.g. "user", "1"

and then if you have a method, which is performing cleanup in following
way:

$dq->do_delete(); //assuming, that setMasterField is there

then you will have delete operation performed WITHOUT master field conditions.

if $select_mode is set to false, then conditions to dsql are not
applied. thus do_delete would clean up all records in the db :)

this is what happened in the test environment in gradpool. so not big
deal, but just be informed that setMasterField is dangerous!!!

potential solution:

  1. add new method
    function applyMasterConditions($dq){
    if ($this->init_where){
    foreach ($this->init_where as $k => $v){
    $dq->where($k, $v);
    }
    }
    return $dq;
    }
  2. if you are using $model->dsql(null, false), then either inside function new_dsql() automate execution of applyMasterConditions, or add to manual to execute this manually. Obviously, if we have "Secure by default", this should happen automatically.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.