jan-vince / smallrecords

OctoberCMS plugin to store and manage records and lists
MIT License
30 stars 11 forks source link

October 2.0 - Error creating a record for the first time (create_onSave) #88

Open Alldar opened 3 years ago

Alldar commented 3 years ago

When creating a record for the first time, an error appears:

SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type integer: "create" (SQL: select * from "janvince_smallrecords_areas" where "janvince_smallrecords_areas"."id" = create limit 1)

Small fix for this: https://github.com/jan-vince/smallrecords/blob/ca43d75a4e155576446c6e6a43f79032db44d87a/controllers/Records.php#L53 Replaced by

$test = parent::create_onSave($areaId, $context);

The issuе is reproducible only in October 2.0, in October 1.0 / Wintercms everything is fine

jan-vince commented 3 years ago

Hi @Alldar, i can't reproduce it :(

I am on October 2.0.29 and I have tested with SQLite and MySQL.

What is your environment? (OS, PHP version, web server, ...)?

Jan