-
Posts
1,317 -
Joined
-
Last visited
-
Days Won
60
BitPoet last won the day on August 19
BitPoet had the most liked content!
Profile Information
-
Gender
Male
-
Location
Near Munich / Germany
-
Interests
programming, writing, scuba diving, long distance hiking
BitPoet's Achievements
-
BitPoet started following [SOLVED] How to save fields on a Process page of a module? , Weekly update – 8 November 2024 , Error handling when using WireDatabasePDO? and 2 others
-
Big thumbs up for that idea. If the timing is right, I might even make it to both, since I'm planning to head across the pond and hike the John Muir Trail next summer. Love the preload method. I've got a shop solution built on PW with about 120k orders and 150k order positions by now, all as pages. Performance is becoming a bit of an issue in the backend with long range price change statistics and detailed Excel exports, and this seems like a perfect use case.
-
Error handling when using WireDatabasePDO?
BitPoet replied to AAD Web Team's topic in API & Templates
WireDatabasePDO's constructur doesn't connect to the database yet. This is either implicitly done when the query or exec(ute) methods are called, or explicitly by invoking $db->pdo(), which will return the underlying plain PDO object. -
Yes, I did. Sorry for the mixup. If upping wait_timeout, deleting individual entries from your image field's table is normally an option, but I'm not familiar with ImageExtra. So I'd make sure to have a working database backup before attempting it. One thing you could try is setting the field you want to exclude from saving to hidden.
-
Is that on a shared hosting server? The error indicates that the execution time of a mysql query was exceeded or a memory limitation in the database was reached, in which case the server aborts the query and drops the connection. Those are often pretty close knit on shared hosts. If you have access to the database itself, the first thing to look at would be wait_timeout. "SELECT @@wait_timeout" will give you the seconds MySQL will spend on a query. If that is very low, you can try setting a higher per-session value through $config->dbInitCommand in site/ready.php. $config->dbInitCommand = "SET NAMES '{charset}'; SET wait_timeout = 300";
-
How would you opt to do a date field with optional DD/MM?
BitPoet replied to cst989's topic in General Support
The question prompted me to put FieldtypeSketchyDate on GitHub. It's a small module I started writing for a solution that never went anywhere, so its pretty basic. It may be a starting point though. In short, it lets you enter 2024 or 2024/10 or 2024/10/11 in the date value, and it also lets you search for 2024/10 and returns all pages with a date between 2024/10/01 and 2024/10/31 as well as those where 2024/10 was entered. So far, it just validates the formatting through the HTML pattern attribute. Proper date validation and calendar UI are still on the todo list. -
[SOLVED] How to save fields on a Process page of a module?
BitPoet replied to PWaddict's topic in General Support
As an alternative, but which also involves some coding: you can also create fields + fieldgroup + template + a "storage" page in your module's install method. Then, in your processForm method, you can fetch that page and assign the form values there, or you just display a modal link to the page editor in your buildForm method and let PW take care of saving the values. That approach can get a bit involved (double so if you want to clean up in your uninstall method), but it can have some advantages (retaining the values after module uninstall, straight forward use of arbitrary field types). -
Consistent errors during installation - does anyone else get these?
BitPoet replied to BrendonKoz's topic in General Support
The first thing I'd look for would be whether there's an auto_prepend_file entry in php.ini. -
The interesting information is probably in the response body for the call to edit/?id=????%InputfieldFileAjax=1.
-
I bet you didn't forget to assign a sensible page name, then ?
-
It should be faster with transaction, and I did add startTransaction and commit in my import script. I'm still trying to figure out where the bottleneck is. Shouldn't be the hardware (i9-14900K, 64GB, high speed NVMe SSD), and I didn't see any io waits in the stats, so something is probably wrong with my db server (MySQL 8.4.0 on Windows 11). Looks like I've got do some forensics there.
-
Yep. About 24 hours on InnoDB for a full import. More that 52k books, 983 genres, 48k characters, 10k publishers, 15k awards. All in all 95314 pages in an otherwise pristine PW installation. I'm attaching a site profile with the data if someone wants to play around. site-bookinventorydata.zip
-
Just a thought for future in case performance really becomes an issue for someone: it's possible to add a generated + stored column to a MySQL table that feeds itself from a dedicated value in a JSON column, and this column can of course have a fulltext index. A hook on PageFinder::getQueryUnknownField could then "redirect" the query to the generated column. Would only work on single valued fields, of course. For anybody interested in creating such a generated field from a JSON field, here's a blog entry that explains it better than I could.
-
You should be able to append the required settings to $config->dbInitCommand.
-
session variable randomly not set in multi instance context
BitPoet replied to elabx's topic in General Support
Did you set $config->sessionName to different values?