Jump to content

jploch

Members
  • Posts

    270
  • Joined

  • Last visited

  • Days Won

    3

jploch last won the day on January 26 2021

jploch had the most liked content!

About jploch

  • Birthday 05/02/1985

Contact Methods

  • Website URL
    http://janploch.de/

Profile Information

  • Gender
    Male
  • Location
    Hamburg, Germany
  • Interests
    Graphic Design, Web Design, HTML/CSS, Javascript

Recent Profile Visitors

4,510 profile views

jploch's Achievements

Sr. Member

Sr. Member (5/6)

179

Reputation

  1. @adrian it still returns the same: '/admin/setup/template/edit : /index.php'
  2. @adrian I added that line to the function and restartet valet, but nothing changed as far as I can tell. I still don't see the field and template infos in the request info panel
  3. it returns: '/index.php' I don't have the file general.php on my system. Maybe it's a Craft CMS thing? Maybe I can update the ProcessWireValetDriver.php file, which I think is doing everithing to make valet and ProcessWire work together. Iam not very exoerienced with valet and php in general, so I have no idea where to start. I got the file from this thread (not sure which version I picked). Here is the code a have in that file, if it helps: <?php class ProcessWireValetDriver extends BasicValetDriver { private $possibleDirectories = [ '', // PW in root, do not remove except you're sure you never use it '/dist', '/public' ]; /** * Determine if the driver serves the request. * * @param string $sitePath * @param string $siteName * @param string $uri * @return bool */ public function serves($sitePath, $siteName, $uri) { foreach ($this->possibleDirectories as $dir) { if(is_dir("{$sitePath}{$dir}/wire")) return true; } return false; } public function isStaticFile($sitePath, $siteName, $uri) { foreach ($this->possibleDirectories as $dir) { if(is_file($staticFilePath = "{$sitePath}{$dir}{$uri}")) return $staticFilePath; } return false; } /** * Get the fully resolved path to the application's front controller. * * @param string $sitePath * @param string $siteName * @param string $uri * @return string */ public function frontControllerPath($sitePath, $siteName, $uri) { $_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST']; $_SERVER['SCRIPT_NAME'] = '/index.php'; $_GET['it'] = $uri; if ($uri === '') { $uri = '/'; } foreach ($this->possibleDirectories as $dir) { if(!file_exists($indexPath = "{$sitePath}{$dir}/index.php")) continue; // $_SERVER['REQUEST_URI'] = substr(str_replace($dir, '', $_SERVER['REQUEST_URI']), 10); $_SERVER['SCRIPT_FILENAME'] = $indexPath; if (file_exists($indexPath = "{$sitePath}{$dir}/install.php")) { return $indexPath; } return parent::frontControllerPath( "{$sitePath}{$dir}", $siteName, $uri ); } } }
  4. Thanks again for looking into this. Here is the dump return (local enviroment): '/admin/setup/template/edit : /index.php'
  5. @adrian Thx! That was fast! The error is gone now. However I still don't see the field and template infos in the request info panel on my local installation. Here is a screenshot of my local request info panel (Viewing the template settings page for template home) And here is a screenshot from my shared hosting, both have the new tracy version installed (Viewing the template settings page for template home) Both have these settings for the info request panel:
  6. I also have issues with tracy since I switched to laravel valet for my local development (Mac OSX Monterey). The panel is loading but I can not see field and template infos in the request info panel. Also I get an error when visiting a template settings page in the admin. The module works fine with the same setup (Site Export) on my shared hosting server. I access my site via http (http://projectname.test). Iam using Tracy version 4.23.25. Here is the template error: ErrorException: Undefined variable: template in /Users/jploch/Sites/PageGrid/dist/site/assets/cache/FileCompiler/site/modules/TracyDebugger/panels/RequestInfoPanel.php:572 Stack trace: #0 /Users/jploch/Sites/PageGrid/dist/site/assets/cache/FileCompiler/site/modules/TracyDebugger/panels/RequestInfoPanel.php(572): Tracy\Bar->Tracy\{closure}(8, 'Undefined varia...', '/Users/jploch/S...', 572, Array) #1 /Users/jploch/Sites/PageGrid/dist/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.9.x/src/Tracy/Bar/Bar.php(141): RequestInfoPanel->getPanel() #2 /Users/jploch/Sites/PageGrid/dist/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.9.x/src/Tracy/Bar/Bar.php(113): Tracy\Bar->renderPanels('') #3 /Users/jploch/Sites/PageGrid/dist/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.9.x/src/Tracy/Bar/Bar.php(87): Tracy\Bar->renderPartial('main') #4 /Users/jploch/Sites/PageGrid/dist/site/modules/TracyDebugger/tracy-2.9.x/src/Tracy/Debugger/DevelopmentStrategy.php(138): Tracy\Bar->render(Object(Tracy\DeferredContent)) #5 /Users/jploch/Sites/PageGrid/dist/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.9.x/src/Tracy/Debugger/Debugger.php(315): Tracy\DevelopmentStrategy->renderBar() #6 [internal function]: Tracy\Debugger::shutdownHandler() #7 {main} I already tried this solution from the linked post above (changing the valet driver), with no success.
  7. @monollonom Thank you! Well what can I say. I swear I tried this and it was not working. I gave it another try and after uninstalling and reinstalling the module it suddenly worked. Sorry! Will read the docs more carefully before I post next time. At least my code may help someone. public function ___upgrade($fromVersion, $toVersion) { $this->createBlock(); }
  8. Hey folks. Iam working on a module that creates some templates and fields. The module creates these on install and deletes them on uninstall, works great. Now Iam looking for a way to run the create function when the module is updated, but It's not doing anything. I changed the version number and hit refreh on the module manager and a message indicated the update, but my function is not executed. Not sure if Iam hooking the right function here or if there is an __update() function I can use? Here is my code so far: <?php namespace ProcessWire; class BlockEditor extends WireData implements Module { public static function getModuleInfo() { return [ 'title' => 'Editor for PageGrid', 'summary' => 'Installs Template and Fields for a PageGrid Block', 'author' => 'Jan Ploch', 'icon' => 'font', 'autoload' => 'template=admin', 'version' => 1 ]; } public function getBlockName() { return array( 'name' => 'pg_editor', 'label' => 'Editor', ); } //function to create block public function createBlock() { $this->message("Create Block"); $this->log->save("PageGridBlock", "Create Block"); $fs = wire('fields'); $t = wire('templates'); $blockName = $this->getBlockName()['name']; $blockLabel = $this->getBlockName()['label']; if (!$fs->get($blockName)) { $f = new Field; $f->type = $this->modules->get("FieldtypeTextarea"); $f->name = $blockName; $f->label = $this->_($blockLabel); $f->tags = 'pgrid'; $f->save(); } if (!$t->get($blockName)) { $f = $fs->get($blockName); $titleF = $fs->get('title'); // fieldgroup for template $fg = new Fieldgroup(); $fg->name = $blockName; $fg->add($titleF); $fg->add($f); $fg->save(); $t = new Template(); $t->name = $blockName; $t->fieldgroup = $fg; $t->icon = $this->getModuleInfo()['icon']; $t->save(); } // Copy block files $copyFrom = $this->config->paths->BlockEditor . "blocks/"; $copyTo = $this->config->paths->templates . "blocks/"; $this->files->copy($copyFrom, $copyTo); } //function to remove block public function removeBlock() { $this->message("Remove Block"); $blockName = $this->getBlockName()['name']; $t = $this->templates->get($blockName); $fg = $this->fieldgroups->get($blockName); $f = $this->fields->get($blockName); if ($t && $f && $t->getNumPages() > 0 && $f->getNumPages() > 0) { throw new WireException("Can't uninstall because template or fields been used by some pages."); } else { if ($t) { wire('templates')->delete($t); } if ($fg) { wire('fieldgroups')->delete($fg); } if ($f) { wire('fields')->delete($f); } } } public function init() { // trigger on module update $this->addHookAfter('Process::upgrade', function (HookEvent $event) { bd('update'); $this->createBlock(); }); } public function ___install() { $this->createBlock(); } public function ___uninstall() { $this->removeBlock(); } }
  9. if you want to use this theme together with the Tracy debugger module. Tracy has an option now to change the position of the bar to the left side:
  10. Iam sorry to bump an old thread, but Iam currently working on a comercial module and looking for ways to make the update process as easy as possible. When I try fgb13 solution above I get this error after clicking on the "check for updates" link on my module settings page: ProcessModule: Error decoding JSON from web service My url is pointing to a zip file with my module files. Is there anything else, that needs to be done? EDIT: Ok I got it working. I had to link to a json file instead. Here is an example of how that file might look.
  11. @horst THX for the quick fix! Unfortunately my client already made the change to PHP 7.4. and I do not have a php 8 environment to test this at the moment. I will report back once I setup a local test environment.
  12. Hi! This is a really useful module. I use it to combine some graphics with the watermark option. However today a host of my client updated to PHP 8 und I got a fatal error: Exception: Cannot load the MemoryImage! After donwgrading to PHP 7.4. everything worked again. The host told the client they will switch to PHP 8 next year and only offer paid support for older versions, so it would be nice if I can continue to use this module. Are there any plans to support PHP 8 in the future?
  13. Hey! Today I discovered a strange behaviour with a fieldtype module Iam currently developing. I have a function that updates the config of the corresponding inputfield module, this functon is called via ajax to update one of the config options (a textarea) with some data. The strange thing is that sometimes it works and then sometimes it saves the new value but deletes all the other config options. Any Ideas why this could be happening? Here is the code that saves the inputfield config, this code is inside a process module and gets called via ajax: $settingsName = $this->sanitizer->text( $_POST['settingsName'] ); $settingsValue = $_POST['settingsValue']; if ( !empty( $settingsName ) && !empty( $settingsValue ) ) { $f = $this->fields->get( "pgrid" ); $f->set( $settingsName, $settingsValue ); $f->save(); return; } (testet on lates PW master Version 3.0.184)
  14. Thanks Adrian! I try to remove those checks and do some testing. Will report back soon.
  15. After some more tests with PageTable, I found out that migrator is not exporting/importing pages under admin. In my use case I have PageTable configured to save all item/pages in a container page under admin. For example admin–>pt-items. However with this setup migrator only exports the main page where the PageTable lives without the items. Placing the PageTable items under admin is a common thing, if you do not want editors to mess with them and keep your page tree clean. I think people also use this approach with PageTableExtended. So it would be nice if migrator would export PageTable items that live under admin or a diffrent parent than the containing page. Since PageTable has a field that saves the IDs of the item pages, that could be used to identify the items. I understand if this is out of scope for migrator. If so I might look into building my own solution.
×
×
  • Create New...