Jump to content

nicolant

Members
  • Content Count

    12
  • Joined

  • Last visited

Everything posted by nicolant

  1. Solved following BillH's advise: $p->icon->first()->set("modified", time()); $p->save("icon"); But it started to work only after addition of the last line! Thank you!
  2. But when I, for example, upload an image in CMS to that field (set to 1 image only), I can check later $icon->modified and it changed. It can be read on field instead of individual file it contains, why cannot it be overwritten?
  3. If I change code to: $pp = $page->find(); foreach ($pp as $p) { if ($p->icon && $p->icon->count() > 0) { $p->icon->set("modified",time()); } $p->save(); $cache->deleteFor($p->id); } It gives error: Item 'modified' set to ProcessWire\Pageimages is not an allowed type
  4. Please help me to figure out, how to set modified timestamp for PageFiles inside hook. Specifically, I need to mark all files fields in a page and its children as updated on save of that page. $files->modified = time() doesn't work. The only way I have found to modify it is to call $file->install() method on each PageFile. It does the job but duplicates files...
  5. Thank you @mtwebit for that module! But I have a trouble with processwire setup with two site folders: "site" and "site-users". Tasker module is installed in site-users/modules folder. How to force processwire to load that modules instead of site/modules? Because runByCron.sh can't find Tasker module: require "index.php"; if (!wire('modules')->isInstalled('Tasker')) { echo 'Tasker module is missing.'; exit; } Nikolay. SOLVED: By addition of $_SERVER['HTTP_HOST']=$siteDomain; before index.php
  6. It remembers userId after login, but not on next reload of content, when if(wire('user')->isGuest()) in Auth.php returns true. Instead in auth() it should again read userId from token, but since $decoded variable is available only in Router... EDIT: It seems that retrieved JWT should be kept in sessionStorage entirely client-side. In order to do that I'd have to use VuexPersist plugin. I'd have to move setting of authorization header (in my case, axios.defaults.headers.common['Authorization'] = 'Bearer ' + this.$store.state.jwt) from mutations.js to Content.vue
  7. Thank you for the profile. I'm trying to move client vue part to another domain. In order to do that, i had to make a few modifications: to Auth.php: public static function preflight() { return "OK"; } to Router.php: header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Headers: Authorization, Content-Type'); . . $r->addGroup('/auth', function (\FastRoute\RouteCollector $r) { $r->addRoute('OPTIONS', '', Auth::class . '@preflight'); . . $r->addGroup('/test', function (\FastRoute\RouteCollector $r) { $r->addRoute('OPTION
  8. Strange behavior in page select field: select links disappear immediately on hover. Please help to fix!
  9. I'm trying to replace default templates for "templates" CKEditor plugin (in site folder) without any luck. My installation runs templates.js from "dialogs" folder (from wire folder). I have seen others have same problem: Please, help. Nikolay Antoshenkov P.S. Just have found solution: Added line config.templates_files= ['/site/modules/InputfieldCKEditor/plugins/templates/default.js']; to config.js
  10. Ryan, thank you for your efforts. I wonder how do you find a time to answer all the questions! You're right, but I'm planning to add separate "Share" button next to "Save" (or checkbox would even better, I think. By the way, could you direct please how to do that?), and in that case I may press and may not press it, and it would be strange to have a FB login page popping anyway beforehand ( I'm still in the beginning of learning facebook API, and it seems that I have to pass through login page before first manipulation with facebook).
  11. Ryan, thank you! That's the point! But now I have to move all the action to the init method. Is it possible to get there an object of page being edited or I have to save it in the session? Code now looks like this: <?php class MySocialIntegration extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Social Networks Integration module', 'version' => 010, 'summary' => 'An example module', 'singular' => true, 'autoload' => true, ); }
  12. Hi. I'm trying to implement ability to post to Facebook after saving a page like this: <?php class MySocialIntegration extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Social Networks Integration module', 'version' => 010, 'summary' => 'An example module', 'singular' => true, 'autoload' => true, ); } public function init() { $this->pages->addHookAfter('save', $this, 'afterSave'); } public function afterS
×
×
  • Create New...