Jump to content

adrian

PW-Moderators
  • Posts

    11,102
  • Joined

  • Last visited

  • Days Won

    365

Everything posted by adrian

  1. This is a start for you that comes from the Migrator module: $p = $pages->get() // use this to get the page that you are importing comments to foreach($comments as $comment){ $c = new Comment(); $p->of(false); $c->text = $comment['text']; $c->cite = $comment['cite']; $c->email = $comment['email']; $c->ip = $comment['ip']; $c->website = $comment['website']; $p->fieldname->add($c); $p->save(); // setting the status doesn't current work due to this: https://github.com/ryancramerdesign/ProcessWire/issues/1034 $c->status = $comment->status ? $comment->status : 0; //need to set after saving to allow setting status without being subject to moderation settings $p->save(); } This assumes that you have already parsed the rows of the CSV file into the $comments array. To do that, take a look at: http://php.net/manual/en/function.str-getcsv.php Hope that helps to get you going.
  2. Then again, if you have Tracy, then look at the PW Info panel and the "Field List & Values" section and you'll get a nicely formatted array, like this:
  3. Try this with Tracy: bd($page->images->getArray());
  4. Perhaps the best thing to do at this point is find the three entries in the field_title, field_process, and pages tables and replace or add them. Just so you know, this is where the Process can be selected: It can't be chosen when creating the page, can be assigned once it is saved the first time.
  5. Can we assume that everything is now working after recreating the module page?
  6. Yeah, sorry, that should probably have been my first suggestion When you recreate it, make sure you choose "ProcessModule" as the Process on the Content tab under title. Actually I wonder if the better way might be to run these three commands to make sure page ID is correct - I am not sure if that matters or not. INSERT INTO `field_title` (`pages_id`, `data`) VALUES('21', 'Modules'); INSERT INTO `pages` (`id`, `parent_id`, `templates_id`, `name`, `status`, `modified`, `modified_users_id`, `created`, `created_users_id`, `sort`) VALUES('21', '2', '2', 'module', '21', NOW(), '41', NOW(), '2', '2'); INSERT INTO `field_process` (`pages_id`, `data`) VALUES('21', '50');
  7. The flags aren't quite that simple - they are more than just on/off - 0/1. I'd like to know more about what you actually see when you try to visit the modules page directly when you have debug mode on. Is it a blank page? Also, what about showing us what is under the Admin branch in the tree:
  8. Sorry - I misread your last post completely. I am running out of ideas - any chance this site is live and I could take a look?
  9. Ok, so if the modules db table is missing that sounds like the problem. If you don't have a backup, I would suggest the best option might be to grab the appropriate section from the install.sql file, eg https://github.com/processwire/processwire/blob/36984e4a057268b7a45b848e1b3b6ee757583459/site-default/install/install.sql#L271-L368 and paste that into the SQL tab in PHPMyAdmin or some other tool.
  10. Do I understand correctly that this happened after installing a new module? Can you remove all its files from site/modules/ and also its line from the modules database table.
  11. Did you try the refresh I suggested? What about logging out and back in again? What about emptying site/assets/cache/FileCompiler?
  12. Can you view the modules page via its URL, eg. mysite.com/processwire/module/ Just trying to figure out if it's just the menu that isn't working. I'd also try calling Modules > Refresh directly, like: mysite.com/processwire/module/?reset=1
  13. Do you have debug mode on? Might be some errors.
  14. Silly question perhaps, but are you logged in as a superuser? Just an FYI - it is possible, depending on permissions, for a user to be able to see the Setup and Access menus, but not the Modules menu.
  15. Hi @Robin S and everyone. I have turned off live dumping by default for the bd() method and added a new bdl() or barDumpLive() method. You can choose which you want to use knowing that bdl() will ignore maxDepth and maxLength settings (thereby dumping the full contents of an object etc) and will be much faster to render the output, but at least for now, it has the side effect of sometimes dumping the wrong object as noted above. bd() will always dump the correct object, but obviously slower and limited by the maxDepth and maxLength settings. As noted in the links referenced in this issue (https://github.com/adrianbj/TracyDebugger/issues/6), there may be a way to make live dumping always reliable in which case I will combine the methods again. Let me know if you have any problems.
  16. BCE won't work for comments, but you can certainly write your own API script to import comments from another source. What format do you have them in? The only gotcha you will come across is this bug (https://github.com/ryancramerdesign/ProcessWire/issues/1034) which prevents you from setting the status via the API, so currently you will need some SQL to fix that. Let us know if you need any help.
  17. Did you do a Modules > Refresh ?
  18. I see that the bottleneck seems to be ProcessPageEdit so I am wondering if it's parts of the admin, or just when editing a page and if it's only one particular page? Do you have a module that is hooking into ProcessPageEdit? Maybe try disabling third party modules with Tracy's Module Disabler panel.
  19. It seems like the title of your post doesn't match what you are asking. Repeater to PageTable is very different from copying FieldtypeTable contents. I have scripts for both, but I assume you want the former based on what you wrote, so take a look at this:
  20. @tkaranka - just wondering if the fixes I made for @mel47 helped with error you were getting? If not, could you please provide some details on the field type that was causing the error and I'll get it fixed.
  21. Thanks @tpr - I forgot to mention that to get that CMD key shortcut to work on MacOS, you actually need this complete combination which includes charCode as well as keyCode: if ((e.metaKey || e.ctrlKey) && (e.keyCode == 83 || e.charCode == 83)) { That is the working replacement for this line: https://github.com/rolandtoth/AdminOnSteroids/blob/0ffbbe3a6fbfc41e155b8df5d2ae119b0d86c5df/Hotkeys/Hotkeys.js#L160 I haven't tested other shortcuts in the Hotkeys.js file nor those in the main AdminOnSteroids.js file, but hopefully this will give you an idea of what is needed for those also. Thanks again.
  22. Hey @tpr - would you mind changing Hotkeys.js instances of: e.ctrlKey to: (e.metaKey || e.ctrlKey) so it's more intuitive for Mac users. Thanks!
  23. I have always been a huge fan of the vector shape side of SVG, but I have never really experimented with all its other abilities. Here's an interesting article on some of the other things it can do: http://go.sitepoint.com/t/ViewEmail/y/28B66532868053D2/93084645AE7B31BD981D23A7722F2DCD Just pinging @horst because it may be of particular interest to him
      • 5
      • Like
  24. haha - in reality it was Google that knew it better than you But I am happy to help maintain it. It might be nice if we have one person assigned to updating the latest stable version / release date info on the list of CMS's just so that a bunch of us don't go looking every week (or whenever you push dev to master which is pretty often these days) to see if it's already been done. I can put it in my calendar to take care of this.
×
×
  • Create New...