• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeExtinguisher 2.0 Release Candidate 14.2

[eluser]abmcr[/eluser]
[quote author="jTaby" date="1212432404"]abmcr, here are lines 244->246 of codexcontroller.php:

Code:
if(count($this->table_access_restriction) > 0)
            foreach($this->table_access_restriction as $field=>$value)
                $this->db->where($field,$value);

[/quote]
I have discovered: in the wiki i read table_access_restrictions but this is an error because it is necessary to use
table_access_restriction. ;-)

IN other post you write
Code:
function execute_add(){
    CodexController::execute_add();
    /* DO SOMETHING HERE */
}
i Have tried with
Code:
function execute_edit(){
    CodexController::execute_edit();
    /* DO SOMETHING HERE */
die("hello");
}

but the hello word not appears ....

[eluser]Majd Taby[/eluser]
ah I apologize, the execute_add function redirects, that's why it doesn't happen. I would suggest you add your own event if you want to change what happens at the events. Take a look at post #113 for the links to the Khaos::EventManager docs

[eluser]Donald Hughes[/eluser]
I created a custom controller and everything works fine except that the form does not repopulate when I try to edit a record. Is there something obvious I'm missing?

[eluser]Majd Taby[/eluser]
did you modify the core? can you paste some code? there's only so much I can help you with before you can give me some code.

[eluser]abmcr[/eluser]
[quote author="jTaby" date="1212443367"]ah I apologize, the execute_add function redirects, that's why it doesn't happen. I would suggest you add your own event if you want to change what happens at the events. Take a look at post #113 for the links to the Khaos::EventManager docs[/quote]

Yes Yes.... i have do it editinbg the kaos/plugin....

[eluser]Donald Hughes[/eluser]
It's a really basic form. I just needed to be able to add custom validators.

news.php
Code:
class News extends codexController
{
    function News ()
    {
        // Load the CodexController
        codexController::codexController();

        $rules['title'] = "trim|required";
        $rules['info_plain_text'] = "trim|required";
        $rules['start_publish_date'] = "required";
        $rules['end_publish_date'] = "required|callback_end_publish_date_check";
        $rules['end_date'] = "callback_end_date_check";

        $config = array(
                    'db_table' => 'news', //The name of the table associated with this controller
                    'form_setup' => $this->spyc->YAMLLOAD($this->codexadmin->getDefinitionFileName('news')), //The array that holds our elements
                    'controller_name' => 'News', //The name of the controller, so that it can be used when generating the URLs
                    'primary_key' => 'id', //The name of the controller, so that it can be used when generating the URLs
                    'display_fields'=>array('title','start_date','end_date','start_publish_date','end_publish_date','info_plain_text','info_rich_text'),
                    'rules'=>$rules
                    );
        $this->setConfig($config);
    }

news.yml:
Code:
title:
    class: TextBox
start_date:
    class: Date
end_date:
    class: Date
start_publish_date:
    class: Date
end_publish_date:
    class: Date
info_plain_text:
    class: TextArea
    attributes:
        cols:70
        rows:12
info_rich_text:
    class: Editor
    attributes:
        cols:70
        rows:12

[eluser]Majd Taby[/eluser]
are you using RC 14.2 from the first post in this thread? I copy-pasted your code and it seems to be working fine.

[eluser]Donald Hughes[/eluser]
I'm sorry, I'm only using rc13. I'll upgrade and see if that fixes my problem.

[eluser]Donald Hughes[/eluser]
I upgraded to 14.2. Now I get a blank page when I try to navigate to my controller (/news). If I specify /news/add, I get the add view, but just going to the controller is a blank page.

I also noticed that the hardcoded paths in codex_choosers.php was causing the interface to be messed up for me since I'm not using the standard application path.

[eluser]Donald Hughes[/eluser]
Some more info on my problem:

Here's the latest thing logged:
Severity: Notice --> A non well formed numeric value encountered /codex2_rc14.2/plugins/date.php 12

Could it be that the date plugin is not working correctly for me, and that is causing the problem?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.