Jump to content

elabx

Members
  • Posts

    1,513
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by elabx

  1. I can at least envision a module filling up a full text search table on a page save hook! Could be pretty useful to have at hand if budget doesn't cover an ElasticSearch/Lucene/Meiliseach instance. Which is my current scenario lol
  2. @rastographics I have also experience that the main site's search doesn't work very well either ? Maybe we should open an issue?
  3. I have found that SQLite has full text search and it is quite fast! I built a couple million rows table and i'm very impressed!! Has anyone had any experience implementing this either in ProcessWire or in another context?
  4. I think this would gain more visibility in the requests repository issues, I've had this issue too! I recently had a request and it got action pretty quickly. https://github.com/processwire/processwire-requests/issues
  5. I can click the button just fine on android Chrome, but can also confirm you are not going crazy I tested in my wife's phone which is an iphone and I can replicate the behaviour! It takes too taps to click the button!
  6. I've seen a lot of commits to support PHP 8+, so I'd say the core will most likely be stable. I'd be more worried about third party modules that might not have been updated recently, so if you are able to, I'd recommend you make a backup and test first in another install with the same environment.
  7. If on Mac, I use ScreenFlow. I think it's a bit pricey but for me it hits the sweet spot in being easy to use and richness in features, in particular I really dig it includes a non linear editor.
  8. Maybe a user permissions issue? It has happened to me that if the system user running the server cannot write the compiled processwire files (if compiled is turned on) it all fails. Though I do get warning in the processwire admin which you don't mention.
  9. Hi! For some reason all my comments added through API get added in the pending state and I don't understand, has anyone had this issue?? Running this through a CLI to read a CSV. $found = $pages->findOne("name={$some_string}"); $found->of(false); $c = new Comment; $c->stars = $stars; $c->text = "$title\n$text"; $c->created = strtotime("first day of $created"); $c->set('status', 1); $c->status = 1; $found->comments->add($c); $found->save('comments'); $found->comments->each(function($item) use($found){ echo print_r($item, true); $item->set('status', 1); $item->status = 1; $found->save('comments'); }); $found->save('comments'); It would seem it has something to do to do with being created in the same request?? I am able to run this in the Tracy console and it just works ? EDIT: Just notices that the $page->comments value is empty when I run this through the CLI and the status is 1! EDIT2: I guess and empty CommentsArray is reasonable since there are not approved comments? Ended up doing: $query = wire('database')->prepare("UPDATE field_comments SET status = 1 WHERE pages_id = {$page->id}"); wire('database')->execute($query); Am I doing something wrong when creating the Comment object? That it's status doesn't get saved when saving the comments field?
  10. damn yessss
  11. @bernhard updated it! For anyone that might come across adding something else on the admin theme's markup, here's a recommendation from Ryan: $src = "https://unpkg.com/alpinejs@3.10.2/dist/cdn.min.js"; $this->wire()->adminTheme->addExtraMarkup('head', "<script src='$src' defer></script>");
  12. @kongondo Also managed to load AlpineJS like this: https://github.com/elabx/AlpineJS Although only works with the edited core version files mentioned above lol Then on the Inputfield on init(), I can do: $this->modules->AlpineJS This was copied from: https://github.com/somatonic/JqueryDataTables Only adding the composer dependency since that's how I want to manage it through the Inputfield actually using Alpine
  13. Thank you both for your answers! I tried to remove the hook like you suggested but the script still gets appended twice in the presence of two of the same field ?. Also added the request here: https://github.com/processwire/processwire-requests/issues/468 Also made the edit here: https://github.com/elabx/processwire/commit/9a261c18a232845d92abe8e411fa48a381563dfd I also dig your version @bernhard , like, if I want defer without value, this kinda looks weird? array( [ 'defer' => ''] )
  14. Just noticing I actually messed up that module with a commit I made but someone already sent a fix, let's hope it gets pushed.
  15. @LexSanchez So, I actually introduced a bug in the module with my last PR sorry about that ?, @gmclelland seems to have pushed a fix for this in this PR, maybe also push the version? Thanks again!
  16. I use this fantastic module: https://processwire.com/modules/video-or-social-post-embed/
  17. @kongondo just out of curiosity, do you know what it would take if we wanted to share the same AlpineJS source for our modules? Have a ModuleJS derived AlpineJS module?
  18. 1000% something like this would be really nice! Do you keep track of where you have injected it somehow? I has previously solved loading it with the following hook on an Inputfield: $this->addHookAfter('AdminTheme::getExtraMarkup', function ($e) { $parts = $e->return; $parts['head'] .= "<script defer src='https://unpkg.com/alpinejs@3.10.2/dist/cdn.min.js'></script>"; $e->return = $parts; }); But then noticed Alpine got injected multiple times if I used the field in a repeater for example, within a page with the same field.
  19. Hi! I am adding Alpine.js to work with an Inputfield I'm building: public function renderReady(Inputfield $parent = null, $renderValueMode = false){ $this->config->scripts->add("https://unpkg.com/alpinejs@3.10.2/dist/cdn.min.js"); parent::renderReady($parent, $renderValueMode); } But seems to be that it requires the "defer" attribute to work correctly, otherwise I get a lot of errors from Alpine. From what I understand, the way the AdminThemeUikit loads the scripts is done here (wire/modules/AdminTheme/AdminThemeUikit/_head.php): // line 55 foreach($scripts as $file) { echo "\n\t<script type='text/javascript' src='$file'></script>"; } I also tried hooking into the AdminThemeUikit::renderFile to basically edit the output after finding the line where the alpine.js is loaded, but it happens multiple times if I setup different fields of the same type in the page (and maybe too hackish anyway??) Does anyone think it's worth making a pull request to make this more configurable? Maybe a hookable AdminThemeUikit:renderScriptTag($filename, $options) method in AdminTheme? I feel it makes sense to be able to add this attributes, since defer is now sort of standardized from what I read around the internet. foreach($scripts as $file) { $adminTheme->renderScriptTag($file); } I tried looking into initializing Alpine components any other way but had no success figuring out how to, yet ? Thanks for further answers!
  20. Exactly this! Solved! Ohh!! This is neat ? Need to upgrade to latest RockMigrations, still on v1!
  21. Hi! @thetuningspoon this is a very old thread haha but wondering if you managed to figure this out? Maybe through a hook after page add?
  22. Seems to be getContext() is available until 3.0.162? https://processwire.com/api/ref/field/get-context/
  23. Just to elaborate on another possible method, since getOptions() returns a SelectableOptionArray inheriting from WireArray, you could also do: $columns = $options->slices(3); https://processwire.com/api/ref/wire-array/slices/
  24. Maybe something like this, but I'm not entirely sure it will work, place it on ready.php: $wire->addHookBefore('Inputfield::render', function($event){ // the field where the field to hide exists $page = $inputfield->hasPage; $inputfield = $event->object; if($inputfield->name != "field_to_hide_if_parent") return; if($page->id){ // maybe check for children of specific type? if($page->parent->template == "specific_type_of_page"){ // the condition on the parent page? if($page->parent->multiselect_field->name == "some-name"){ $inputfield->collapsed = Inputfield::collapsedHidden; } } } });
  25. Yeah your approach seems reasonable, would love to know if you manage to solve with with just the access control. I had always used the isLoggedin() method, and never ocurred to me that it'd be reasonable to just disable 'view' for guests in a specific template. I mean, if it can actually work like that haha.
×
×
  • Create New...