Code Monkey home page Code Monkey logo

Comments (13)

johansolve avatar johansolve commented on June 3, 2024

This was fixed in 67f2e75 in the 9.3 branch

from knop.

monsterlane avatar monsterlane commented on June 3, 2024

Oh sorry I checked the releases tab but I didn't check the list of branches. I've replaced all the files with ones from the 9.3 branch and now I'm getting this error:

Error:

An unhandled failure during a web request

Error Code: -9948

Error Message: Definition Not Found: knop_database->select(array) Candidates were: knop_database->select(search::array, sql::string, keyfield::string =?, keyvalue =?, inlinename::string =?), knop_database->select(-search::array =?, -sql::string =?, -keyfield::string =?, -keyvalue =?, -inlinename::string =?)

I can browse the customer table from my instance in Lux and I'm using the same user/pass in cfg__global.inc. It doesn't seem like it has a connection?

from knop.

stevepiercy avatar stevepiercy commented on June 3, 2024

Unfortunately the demo files have not kept up with the updates to the 9.3.x branch.

PR's are welcome.

from knop.

monsterlane avatar monsterlane commented on June 3, 2024

Ok this is my first time using Lasso any clue's on what to look for? I'm lost at the moment. I was hoping to get the demo running so I can try to make sense of the framework.

from knop.

johansolve avatar johansolve commented on June 3, 2024

In _library/lib_customer_list.inc, change line 20 so that the search array is a named param, like this:

    $d -> select(-search=$searchparams);

The same for other occurences of ->select

from knop.

monsterlane avatar monsterlane commented on June 3, 2024

Thanks! I've made that change in _library/lib_customer_list.inc and _library/lib_advanced_list.inc and most of the site is working. When I go to the login page and submit the form I see this:

Error:

An unhandled failure during a web request

Error Code: -9948

Error Message: Definition Not Found: knop_form->username()

from knop.

johansolve avatar johansolve commented on June 3, 2024

->username is a shortcut to ->getvalue('username'). Shortcuts of that kind (using _unknowntag) are no longer supported in knop9 due to issues with signatures in method definitions

from knop.

johansolve avatar johansolve commented on June 3, 2024

The old Knop reference at http://knop.nu/ can be helpful, but keep in mind that it's not updated for knop9.

from knop.

monsterlane avatar monsterlane commented on June 3, 2024

Thanks again! I changed the two lines in _action/act_login.inc and now I can submit the form but then it errors out again with this:

Error:

An unhandled failure during a web request

Error Code: -9948

Error Message: Definition Not Found: knop_user->firstname()
Error Detail:
Line    Char    File
2   55  //Users/jonathan/Sites/spiri/public//_content/cnt_login.inc

I tried changing that to knop_user -> getvalue('firstname') but it didn't like that either.

from knop.

monsterlane avatar monsterlane commented on June 3, 2024

Figured it out, the site works now. Line 2 in _content/cnt_login.inc should be this:

<p>[$lang_ui -> loggedinas(-replace=array($s_user -> getdata('firstname'), $s_user -> getdata('lastname')))]</p>

from knop.

monsterlane avatar monsterlane commented on June 3, 2024

Another bug:

        [if ( $message->size );]
            <p class="message">
                [iterate( $message, var( 'messageitem' ) );
                    loop_count > 1 ? '<br>\n';

                    if ( $messageitem->type == 'pair' );
                        $messageitem = ( '<span class="' + ( $messageitem->first) + '">' + ( $messageitem->second ) + '</span>' );
                    /if;

                    $messageitem;
                /iterate]
            </p>
        [/if]

from knop.

stevepiercy avatar stevepiercy commented on June 3, 2024

@monsterlane can you elaborate on "another bug" by providing the error stack?

Where does the code snippet above come from?

FWIW, I'm finally working through the Knop 9 demo site bugs.

from knop.

stevepiercy avatar stevepiercy commented on June 3, 2024

@monsterlane I believe this is not an issue with the code, but with the database.

Knop tries to insert a record for Customers Simple form:

INSERT INTO `knopdemo`.`customer`
(`firstname`,`lastname`,`email`,`password`,`enabled`,`keyfield`)
VALUES ('h','h','h','demo','1','F881752F-AFE5-4833-BF6E-E783E6972B91')

Note that there is another field that disallows the insertion of NULL for a text field. This is just wrong. A text field cannot have an explicit default value, so one should allow NULL so that an implicit default value of NULL may be inserted when no value for the text column is supplied. See https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html

This should fix the issue:

ALTER TABLE `knopdemo`.`customer` CHANGE COLUMN `message` `message` text;

I noted that on MySQL 5.5, I was able to insert a new record via the Customers Simple form, but not on MySQL 5.7. Perhaps something changed between those versions, too, or my servers have different settings for strict mode.

I'm closing this issue via: fa942ec

Feel free to open a new issue with a reproducible example and error messages.

from knop.

Related Issues (20)

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.