Jump to content

Mikie

Members
  • Posts

    191
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mikie

  1. Coolio, no rush. I think this might have also been to do with having html entity encoders set on those ckeditor fields. Have no idea why I did that, maybe I did it testing something else.
  2. Sorry for the spam, but found a solution. I am not an expert on prepping strings for the database, but replace the line here with the below to make it unicode aware fixes things for me: $processed_index = preg_replace('/\s+/u', ' ', $processed_index);
  3. @teppo I don't think this is to with my setup. I have tried 3 x different character sets and encodings, all throwing errors. In particular... if I dump the result of processIndex() just before returning it, with that "à" character it is getting encoded as \xc3 when it should be \xC3\xA0. You can check this here: https://mothereff.in/utf-8. I don't understand enough about how you are prepping the data before saving the field, but this I think is an issue with multibyte substrings.
  4. Actually this isn't occurring on staging server. Feel link something is up with my mysql.
  5. Hi @teppo come up against a weird bug with certain special characters. Its hard to isolate but for example the character à is throwing "SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value" in ckeditor fields (but not title fields).
  6. Also think getting it at least installable with composer, if not packaged as phar file would help for now.
  7. Thanks! Anyone interesting in taking this project over? Given tools like this are part and parcel of a good developer experience these days I feel it is important to keep this project active to attract new devs. I would happily contrib to setting up new docs. Just been mucking around with vuepress, makes docs a cinch.
  8. Ah, this makes sense, it felt like something like this was happening. Nice work keeping it under control! I'd be paranoid about bill shock. Those bandwidth fees...
  9. Cool thanks guys. Now that I think about it the other install I tested on probably didn't have debug on as it was a live site.
  10. Anyone know what would cause this? Is it a failing endpoint somewhere, or a misconfiguration in a local module I am working on. Only being thrown on one install.
  11. Cheers! I am storing magazine style story credits (role, name, website url etc) in the Table. I feel that since Table only accepts text based fields this is an ok candidate for indexing. Can try to hack away at your module myself for now, no rush. Yeah I originally was thinking I wanted to use a client side library like to handle the search itself (fuzzy style to handle mis-spellings eg https://rawgit.com/farzher/fuzzysort/master/test.html ), but now I am thinking that is overboard and probably confusing. Will most likely stick with your module / pw search, and just do client side querying / rendering. Cheers!
  12. This set up definitely helps. I am working on a pretty complicated site with Padloper, ProMailer, SearchEngine, LoginRegister and a bunch of other modules that want to render their own markup in different places. Also I am using url segments and query strings all over the place. Disabling auto rendering makes this all much easier to manage. Eg in screenshots above I am testing the SearchEngine module. Url /search/ does latte with the rendered SearchEngine markup, url /search/index/ is outputting json of the whole index with different content headers. I don't think this is possible with auto rendering, at least not in my attempts.
  13. Seems to work fine. If you mean the below (also in template filename):
  14. Hi @porl, I have a functioning TemplateEngineLatte for TemplateEngineFactory module going which covers all my notes above (except the error logging). Figuring out the best way to be able to render independent snippets. So maybe ignore all my comments above. Can send to you if you want, its wip for personal use at the moment, but it works.
  15. Hey @Wanze. I am wondering if I could request an additional empty "config" array in the render method. This would let TemplateEngine modules do some more logic their end, eg override module config settings. The reason for this is for whatever reason I seem to find myself wanting to render template partials without worrying about or needing the global data object (just explicitly pass params), however I would also like the global data object populated generally. Eg... <?php $factory->render('partial', ['foo' => 'bar'], ["global_data" => false] ));
  16. Hey @teppo great module thanks! Would it be possible to add support for ProFields: Table fields? Also is there / can I request a method to get the whole index for json output. I want to use this with a client side fuzzy search library. Currently my needs aren't that complicated, I am indexing two templates so I can just get the index field from those and the other data I need around it manually which is perfectly fine. Perhaps this is the correct way to do it.
  17. @tpr are you still using this? Seen mentioned elsewhere you weren't doing much php anymore. @porl nice stuff! Tested here and all working fine. A few more notes if you are mucking around with things... 1. With the below, does it make more sense to have a checkbox that lets you add a default layout file? I know this isn't 100% backwards combatable but the toggle could checked by default. 2. Should there be an option to disable automatic rendering, thus needing to call the module and manually render views? I know its less magic but I prefer being declarative about this stuff, this would add some flexibility with file naming and management, plus would solve a lot of issues with other types of files and capturing things. 3. A way to render latte snippets that aren't view files would be nice. Maybe I can call latte directly to do this? <?php $tlr = $modules->get("TemplateLatteReplace"); $view->social = $tlr->renderSnippet("partials/social-icons.latte"); 4. Should the render hook be Page::Render not TemplateFile::Render as Wanze discusses here for TemplateEngineFactory? Would this move towards fixing any of the render issues? The rendering via template engine is now integrated correctly into Page::render(). You can call the render() method on any page, and the module will render it via template engine. In version 1.x, this is only true for the current page. 5. Errors get logged with reference to the compiled cache file and not the .latte template itself. Just a brain dump of nice to haves, the module still works great.
  18. Does anyone know what is involved for connecting products to / selling through instagram? Done a quick search but not really clear, just thought I'd check if anyone had more experience. In the context of Padloper v3 I'd assume this might end up being handled by an external module as I haven't seen mention of it in this thread.
  19. Hey is there any setting to disable / hide Crop and Actions on images fields? All I have found is the below, is this still the answer?
  20. Hi @kongondo, I don't know where I got it but my initial impression of your variations module was that it was using sqlite or something. Just had another look and believe I am wrong, everything seems to be in templates and pages.
  21. Will also say that when troubleshoot npm issues (just then I had problems with BrowserSync not refreshing css changes!) I find it is usually to do with outdated modules. The following usually fixes for me: - run https://www.npmjs.com/package/npm-check-updates and update your dependencies to latest - wipe contents of node_modules_folder - delete package-lock.json - run npm install
  22. Cool. Sounds like you are sorted. On the node / npm front, I think the easiest way to wrap your head around using node for build systems is to skip the bundlers and task runners and just use npm scripts. The benefits of this are you are using the cli's of each library you install directly, and not interacting with wrappers and plugins build upon these. This makes things easier to debug / easier to reason about. Here are some blog posts on this topic: https://www.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/ https://deliciousbrains.com/npm-build-script/ https://scotch.io/tutorials/using-npm-as-a-build-tool For browsersync in particular, the below cli commands are all you will ever need to know: # static site browser-sync start --server 'public' --files 'public' --browser 'Google Chrome' --no-notify # php site with local domain using eg dnsmasq browser-sync start --proxy 'localdomain.test' --watch --files public/site/templates --browser 'Google Chrome' --no-notify After years of npm scripts I now use https://github.com/sezna/nps and https://github.com/kentcdodds/nps-utils for cross platform builds. Here's an example package-scripts.js: /* global require */ /* global module */ const { series, concurrent } = require("nps-utils"); module.exports = { scripts: { css: { dev: "gulp cssDev", build: "gulp cssBuild" }, js: { dev: "rollup -c rollup.config.dev.js" build: "rollup -c rollup.config.prod.js" }, server: { start: "browser-sync start " + "--no-inject-changes " + "--proxy 'localdomain.test' " + "--watch --files public/site/templates public/static " + "--browser 'Google Chrome' " + "--no-notify " }, watch: { css: "chokidar 'src/stylus/**/*' -c 'nps css.dev'", js: "chokidar 'src/js/**/*' -c 'nps js.dev'" }, dev: { pre: series.nps("css.dev", "js.dev"), main: concurrent.nps( "watch.css", "watch.js", "server.start"), default: series.nps("dev.pre", "dev.main") }, build: series.nps("css.build", "js.build") } }; Then in package json you just have: { ... "scripts": { "dev": "nps dev", "build": "nps build" }, ... } Cd to your projects and: # run dev w/ livereload npm run dev # run your build (minification etc) npm run build # test individual nps commands npx nps server.start I'm using gulp for css since I use stylus and gulp is the easiest way to run stylus through a bunch of postcss transforms. Rollup is by far the easiest way to bundle js in my opinion. Here's my rollup build file pretty much for every project. The dev version doesn't include terser and sets source maps to true. /*jshint esversion: 6 */ import resolve from "rollup-plugin-node-resolve"; import commonjs from "rollup-plugin-commonjs"; import buble from "rollup-plugin-buble"; import { terser } from "rollup-plugin-terser"; export default { input: "src/js/main.js", plugins: [ resolve({ mainFields: ["module", "main"] }), commonjs({ include: ["node_modules/**"], sourceMap: false }), buble(), terser({ compress: { drop_console: true } }) ], output: { file: "public/site/templates/assets/main.js", format: "iife", sourcemap: false } };
  23. In my case, installing a module with the same class name as a personal module I had been working on broke my site. Wiping the site/assets/cache and session files and removing the offending module folder didn't work, so I emptied the caches database table. This restores access to the admin, however I then get a bunch of errors about Inputfields not existing like the screenshot in the original post in this topic. If I then refresh my modules the site breaks again with a specific "Class not found" error. The fix is to re-order the offending modules declared in the Modules.site/modules/ row of the caches table in the database, as explained here: Regarding "This request was aborted because it appears to be forged!", the only time I have seen that was when I was on a load balanced internet connection, eg a router splitting access to two WANs. I hadn't configured the router to keep individual local ips on the same connection, and thus it kept switching my computer's public ip and the only reason I figured this out was 1. processwire 2. banking websites!
  24. Mikie

    HTTP/2 Push

    @dragan cool thanks. Adrian is wondering if pw core should be doing any of this. Any thoughts on what could specifically be optimised in the admin?
  25. Mikie

    HTTP/2 Push

    There is also: https://www.tunetheweb.com/performance/http2/http2-push/ https://icing.github.io/mod_h2/push.html https://www.manning.com/books/http2-in-action
×
×
  • Create New...