Jump to content

BitPoet

Members
  • Posts

    1,110
  • Joined

  • Last visited

  • Days Won

    47

BitPoet last won the day on July 9 2020

BitPoet had the most liked content!

5 Followers

Profile Information

  • Gender
    Male
  • Location
    Near Munich / Germany
  • Interests
    programming, writing, scuba diving, long distance hiking

Recent Profile Visitors

7,270 profile views

BitPoet's Achievements

Hero Member

Hero Member (6/6)

2.6k

Reputation

27

Community Answers

  1. It's very likely, as this post in the module's support thread suggest: I'm not familiar enough with ProcessChangelog (nor ProcessDatabaseBackup) to guess at the technical issue behind that, but maybe @teppo as the module's author can shed some light on it.
  2. More likely memory_limit, not post_max_size. The first thing I'd try is to uncache pages in your executeAction method, but if your database is huge (any kind of logging going on like ProcessChangelog?) upping memory_limit might be the way to go.
  3. As @Jan Romero wrote, its more often than not that a link's textual information is generated dynamically from its relationship (e.g. the page/template it's on or that's referenced). For manual entry of link texts, creating separate fields for the link target and the text like you did is the way to go. You can, however, make your developer life easier when you have multiple occurrences of that combination in different templates by wrapping both in another field type. This can be a Repeater if you have multiple entries, or for a single one you can use either FieldsetPage or FieldsetGroup, depending on whether you want the link entry to live under a unique property of your page. With fieldsetgroup it is $page->urlfield and $page->linktextfield, while in fieldsetpage its $page->myfieldsetpagefield->urlfield and $page->myfieldsetpagefield->linktextfield. The former is more performant, while the latter makes it more clear that both fields are related.
  4. Or install @tpr's AdminOnSteroids module which, among many other really convenient shortcuts, adds a "clear" button to PageListSelects.
  5. What's the error message you get? Maybe a stupid question, but did you enable .heic in the image field's allowed extensions?
  6. That's strange. Somewhere along the way, PagePathHistory::__upgrade should have been triggered and added that column. The language_id column was introduced with version 2 of the module, shortly before PW was moved to the new GitHub repo in 2016. There was an identical issue mentioned back then, and Ryan added a self-healing fix in PagePathHistory::getPath, but it looks like he took that out after a few years. You can, however, add that column manually to get rid of the error and put the language_id back into the select: ALTER TABLE page_path_history ADD language_id INT UNSIGNED DEFAULT 0
  7. Behind the scenes, the admin user is a page with the id 41, so you can determine the username by running the following sql query: select `name` from `pages` where `id` = 41; The quickest way to reset the password should be this:
  8. You're inside a function, so there's no global $datetime object. wire('datetime') should do the trick.
  9. Yes. Sorry. Not sure what's the error with wireEncodeJSON, might be a namespace issue or something else. But your code looks fine to me. Maybe outputting $jsConfig in a comment block or calling json_last_error_msg() can give you a clue about the empty array.
  10. By default, the ProcessWire object is only output in the backend or if you have frontend editing active. Otherwise, you need to add it to the html head in your your php template like this: <script> var ProcessWire = {config: <?= wireEncodeJSON($config->js(), true, $config->debug) ?>}; </script>
  11. The topic comes up regularly, so there's already a ton of information in the forum. If url segments for the building template aren't needed, this solution should cover the requirements:
  12. I'd expect that calling $cachedPage->yourcommentfield->renderForm() in your uncached page's template should do what you want.
  13. There's a typo there, it should be "->" instead of ">-", sorry for that. <?php // Expressive version: echo $p->nativeField->get('fifth-row')->value; // If the native field's name adheres to PW's field name rules, you can shorten that: echo $p->nativeField->fifthrow->value; // Stringification returns the stringified value, not the object echo "{$p->nativeField->fifthrow}"; That would be another step further. For now, it's just configuration options for each different kind of input (text, int, float...). I'm not sure if that would offer much advantage over regular fields, but I'll give it some thought.
  14. I've changed that so it only checks for minimum MySQL Version. Still, the module is very much alpha code and work-in-progress. I haven't gotten around to apply and test the field type configuration options, and there are quite a few rough spots in the existing code. FYI, I decided to rename my helper classes as I realized that JsonData and JsonValue may make nice names for core classes. To avoid clashing and hogging names I've prepended "JN", so it's JNJsonData and JNJsonValue now. The new release is still in testing stage and can be found here.
  15. Hi Ivan, I never really looked at API usage up to now (and once I did, I noticed that the module really should be namespaced). Here's a short example for filling values in code: <?php namespace ProcessWire; /* Fill the JsonNativeField field "nativefield" in Page $p through API */ $fdata = new \JsonData(); // This is the class for a JsonNativeFieldValue $fdata->set('first-row', new \JsonValue('text', 'Text in first row')); $fdata->set('second-row', new \JsonValue('integer', 123)); $fdata->set('third-row', new \JsonValue('float', 3.1415927)); $fdata->set('fourth-row', new \JsonValue('date', time()); $fdata->set('fifth-row', new \JsonValue('datetime', time() + 3600)); $p->of(false); $p->nativefield = $fdata; $p->save(); /* Change value for "fifth-row" in our field */ $p>-nativeField->set('fifth-row', new \JsonValue('datetime', time() - 3600)); $p->save();
×
×
  • Create New...