-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
PNG file size increased on image upload
LostKobrakai replied to wsjmdavies's topic in General Support
Exactly that. But the defaults for the latter one will probably change for the image UI update. -
PHP 6 was never released as stable php version (and discontinued years ago) and 5.3.8 is also not the most recent version to run. I'd really doublecheck if that's the hoster to go.
-
It's not an issue in terms of security, but rather a (probably small) performance consideration. It just prevents an unnecessary mysql query in case a negative int is supplied.
-
Wondered about the same thing a few weeks ago. It's just not clear enough that an error, which pops up on each request and leaves things mostly functional, does prevent publishing of pages. https://github.com/ryancramerdesign/ProcessWire/issues/1759
-
intUnsigned() is still better, because you won't hit the db for an possibly invalid id, even though negative values might be a rare edgecase.
-
Even better is $sanitizer->intUnsigned() as id's cannot be negative.
-
Ok, so it seems really like the repeater does just not pick up it's pages for whatever reason. For the record, which pw version are you using?
-
To add to my post above. You'd need to use "sort=parent", but if that's the case it should only render the restaurant name once and all it's dishes below it. If that's not what you want then I don't understand your request.
-
$dishes = $pages->find("…, sort=parent, sort=XX"); $parentID = null; foreach($dishes as $dish) { if($parentID === null || $dish->parent->id !== $parentID){ $parentID = $dish->parent->id; // render restaurant headline } // render dish list item }
-
I'm mostly interested in the class (get_class() will make it shorter) and if it's a PageArray in the ->count(). Also $register is sufficient.
-
Ah, did you really do $page? In your case the page seems to be $register.
-
How to get all possible values stored for a field
LostKobrakai replied to dps123's topic in API & Templates
I think the mysql variant would certainly be the most performant. Otherwise you'd need to load all pages holding that field into memory, which is probably not your intend. -
My replace Textformatter does not work. Please help
LostKobrakai replied to dotnetic's topic in General Support
If you don't need the $page / $field info I'd rather just use the format(&$str) function. Also I don't really see the need for preg_replace_callback(). preg_replace should be enough as it's already replacing all occurrences, as long as you don't tell it to do otherwise. -
You'd need to use var_dump() to actually see what's returned.
-
The last thing to try would be if theres a difference between $page->getFormatted('mt4') and $page->getUnformatted('mt4').
-
Does $pages->get(1227)->platform work? It seems like the repeater field doesn't correctly load it's content/pages.
-
It does look like it should work. What does "$register->mt4->count()" return?
-
Why checking existence of a session variable always return false
LostKobrakai replied to adrianmak's topic in General Support
Sanitizing inputs – all of them. -
Wishlist: Group field for grouping fields
LostKobrakai replied to steveooo's topic in Wishlist & Roadmap
Table is for multiple instances of a group of fields, likewise are pagetables and repeaters. There's currently no fieldtype, which groups fields for only a single instance. Maybe a single-page field could be considered that, but I doubt people being pleased with that solution. -
Wishlist: Group field for grouping fields
LostKobrakai replied to steveooo's topic in Wishlist & Roadmap
That's just not how processwire does work. Templates do each have a dedicated fieldgroup. This fieldgroup can just hold fields and not groups. One could build a system around that, which does automatically update the fieldgroups of selected templates, but Ryan didn't seems to consider – in other topics about the same request – adding the ability to add groups as equal members of a template as fields. It just doesn't work that way in the internals. -
Why checking existence of a session variable always return false
LostKobrakai replied to adrianmak's topic in General Support
And (again) $session->cart_item is not a variable, it just does return or receive one. You need to update the array separately. $cart_item = $session->cart_item; $cart_item[10]['quantity'] = 20; $session->cart_item = $cart_item: -
Why checking existence of a session variable always return false
LostKobrakai replied to adrianmak's topic in General Support
$session->cart_item is not a variable, which you could check for existance. It's an object ($session), which you ask for a specific key (cart_item). This will either return the item or null if the key is not found. -
Wishlist: Group field for grouping fields
LostKobrakai replied to steveooo's topic in Wishlist & Roadmap
One could create a Fieldtype, which does kinda link to a set of fields, so one could use $page->group->name, while technically $page->name would also work. Is that what you're looking for? -
There are already a bunch of topics about exactly that topic. Currently your options are pagetable, pagetable extended or matrix fields, where the last one is a commercial pro module. Depending on the specific need one might be a better fit than the other.
- 3 replies
-
- 4
-
- redaxo
- modularity
-
(and 1 more)
Tagged with:
-
Save a value when a page is added using ready.php hook
LostKobrakai replied to cb2004's topic in FAQs
$event->object will always give you the object the hook function is on. In this case it's pages. $pages->addHookAfter("added", function($event) { // $pages = $event->object; $page = $event->arguments(0); if($page->template->id == 46) { $page->setAndSave('text_1', "test"); } });