Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Have you tried $field->message() ? Personally I have used $session->message() with success - I honestly haven't looked into it properly, but maybe it's a page reload issue which is why the session version works. Maybe someone else has used these more or looked into exactly what is going on a little more thoroughly.
  2. I don't think I ever saw your admin bar - did you mention it in the forums? Maybe I just forgot On the hookable side of things, I have been thinking about making both the Debug bar and User bar hookable to make it easy for you guys to extend. For the moment I thought this custom code entry for the User bar was a good starting point to gauge interest. Let me know if there are any changes I can make to simplify things for you.
  3. Thanks for your post @BrendonKoz - I have never actually used this module, despite contributing a fair bit of code to it, so I haven't really been pushed into finding a solution. I'd love to hear from @Werner Pilnei whether he has success with your version of fMailbox.php - if it solves his problems then it sounds like it might be the best solution for now. Thanks again!
  4. You can now also add your own features to the User Bar: In this case it's a link to Google Page Speed for the current page, but you might choose to link to a specific page in the PW admin, perhaps a ListerPro page - maybe bookings or orders, or whatever you want. An SVG icon is probably the easiest approach, but it's up to you. The entire thing is rendered from custom php code that you enter in the config settings. You can make use of the $iconColor variable in your code to have it match the icon color you defined in the Icon Color setting. Of course you can return multiple icons with this code block. By default, all logged in users who don't have Tracy Debugbar permissions we see these custom feature icons, so you may wish wrap this in a: if($user->hasPermission('page-edit')) {
  5. No - there is the list to install from - that's why I showed you that screenshot. That "Install predefined system permissions" is available from 2.7 onwards. Maybe even before, but it's definitely in the current stable as well as 2.8 and 3.x
  6. Permissions > Add New > Install predefined system permissions. Or you could just type out that permission name manually.
  7. You should be able to get the page from this: $page = $event->object->getPage(); But the other thing to consider is that I think what you are trying to do is already support by a core permission. Try installing that "page-edit-created" permission. It may not be as flexible, but worth point out in case you didn't know about it. The other thing is that you don't need a full module for small snippets like this - you can place the code in /site/init.php instead.
  8. Thanks @Juergen - it should be fixed in the latest version.
  9. https://github.com/ryancramerdesign/ProcessWire/search?utf8=✓&q="function+message" That should give you an idea of what the message() method does in various contexts. Basically it is for sending a message (green for success). You can also use: error() for red. https://github.com/ryancramerdesign/ProcessWire/search?utf8=✓&q="function+error" The default method for each of these is the one in the Wire.php file Most(all?) of the versions are in classes that extend Wire, so they are extending that base method.
  10. Is this what you are looking for: https://github.com/ryancramerdesign/ProcessWire/blob/7e8c7c6836282b6b64de81263f5aaa8112fd51ae/wire/modules/Inputfield/InputfieldForm.module#L95 Remember though that each fieldtype (textarea, text, integer, file, image, etc) is defined and processed by the Inputfield (https://github.com/ryancramerdesign/ProcessWire/tree/master/wire/modules/Inputfield/InputfieldImage) and Fieldtype (https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeImage.module) modules. Those links are to the Image field. If that doesn't help, maybe let us know a little more about what you are trying to do.
  11. I have added some simple styling options for the User Bar. Definitely nothing fancy yet, so let me know if there are any particular settings you'd like to be able to tweak. It can definitely look a lot more stylish now, eg.
  12. Repeaters have had a major overhaul since that comment by @tpr https://processwire.com/blog/posts/processwire-3.0.4-repeaters-revisited-preview-of-profields-matrix/#major-upgrades-to-repeater-fields https://processwire.com/blog/posts/more-repeaters-repeater-matrix-and-new-field-rendering/#repeater-upgrades-continued-in-pw-3.0.5 and there is also the new Repeater Matrix fieldtype: https://processwire.com/blog/posts/processwire-3.0.4-repeaters-revisited-preview-of-profields-matrix/#new-profields-repeater-matrix-field
  13. Hi @Zeka - at a quick glance that looks like a core bug. What happens if you change that line to: if($this->wire('config')->debug) $this->message("changeFieldType loses table field '$value'"); If that fixes it, could you please post an Issue on the PW Github issues page? Note that of course Tracy is not causing that Notice, it's just that by using Strict Mode you are forcing it to behave like a fatal error. It would probably go un-noticed by everyone else. On an unrelated note - do you know why all the links in your Tracy config settings are styled with strikethrough text?
  14. Introducing the new "User Bar" If enabled (currently off by default), this bar is displayed for users that don't have Debug bar permissions (typically all non-superusers) Currently it has three features: Admin, Edit Page. Page Versions The first two are simply links from the front-end to the root of the admin panel, and a link to edit the current page in the admin panel. These are quite similar to horst's ALIF module, but I was thinking if you are using Tracy anyway, then why not have it provide these buttons for other users who have editing permissions. Now for the first of the unique features: Page Versions. This is a simplified version of the Template Path panel that is available from the Debug Bar. It is also similar to the User Dev Template option, but this one allows the user to try multiple options that you provide. Remember you can always have the alternate template files load different js/css etc files as well, so you can provide a very different version of a page for your users to test. To make it more friendly for your clients/editors, the labels in the list are formatted to look like page names, rather than filenames. The user simply selects an option and the page instantly refreshes showing the page using the alternate version. Even if you have the Page Versions option selected in the config settings, it won't appear on the User Bar unless you have alternately named template files matching this pattern: "home-tracy-alternate-one.php" etc. The key things are the name of the template, plus "-tracy-", plus whatever you want to appear in the list of options, like "alternate-one", plus .php Users must also have the "tracy-page-versions" permission assigned to their role. My next goal for the User Bar is the Feedback / Tickets / Review functionality that was discussed earlier. I know this is starting to take this module beyond just a debugging tool, but I think it's nice to have all this stuff accessible from the same place, so that when you as the developer look for a user submitted support ticket, it will be part of the Tracy Debug Bar. Of course I am also planning a central admin interface for managing all tickets in one place, but I still think it makes sense to be able to submit them from the page in question and also view them from the page as well. It certainly needs some styling improvements etc, but is functional already. I will probably make it possible to define custom styling/positioning in the config settings. Please test carefully before enabling this new User Bar on a live site! Maybe it's time this module gets renamed as the "Tracy Developer Toolbox"
  15. Ok, I still can't reproduce here - from reading about that object it should only be an object if output formatting is off. Anyway, I have committed a new version which should prevent the error - the PW Info panel might not display the contents of that object as an array how I'd like, but it should hopefully work for you for now until I can reproduce and format properly. Please let me know if it fixes the error for you.
  16. Please try enabling the Dumps Recorder panel - the dump is probably being lost due to a page redirect or something. If you still don't get anything returned, can you please try: bd($outValue); at line 311 - just before the if(is_array) line. Thanks for your help with this.
  17. @Juergen - would you mind adding: bd($val); to the line before 315 - ie just inside the foreach and let me know what is returned.
  18. @Juergen - I might also need some more info on the content of the troublesome pages. I am not really a ML user, but I have it installed and have a field which is set to ML and I have content in both languages, but am not seeing an error. Can you figure out what is specific to those pages?
  19. Thanks for the report - what version of Tracy are you running? Just want to be sure that reported line number is pointing to what I think it is. If it is easier, you could just post the contents of 315 of ProcesswireInfoPanel.inc
  20. Sorry, did you read my updated post - you replied too quickly
  21. Did you restart apache after running apt-get? What about the php5-gd package? Nevermind you are running PHP7. I thought GD was included with php these days by default. Any chance PHP was manually compiled, rather than installed via aptitude? What does this return? php -i | grep -i --color gd
  22. I don't think this is an option - I think you need to format yourself with something like PHP's date()
  23. @szabesz - thank you for the offer of putting together a flow chart. It might prove useful, but I am honestly wondering whether the fact that we are even discussing the need for a flowchart means that I have failed - if something is complicated enough that we need a flowchart, I get the feeling it needs be to simplified. Thanks for your thoughts on this - maybe I should at least remove the "show the debugbar to everyone when Detect determines localhost" behavior - that seems to be a confusion.
  24. Actually in response to Macrura's question I want to clarify some things - Tracy active vs the debug bar visible vs Production/Development are all different things. Once installed, Tracy is always active. Even unchecking "Enabled" loads some files - these files handle your bd(), d(), fl(), l(), da() calls so that non Tracy users / guests won't get undefined function errors in case you have some of those calls in your live code. In Production mode Tracy is fully loaded to handle all errors, but it doesn't display those errors or the debug bar - it logs the errors and can email you of an error (if you have the settings configured with your email address and "Allow Logging in Production Mode" checked. In Development mode (either set or determined from Detect mode), errors and the debug bar are displayed (although the debug bar can be hidden from front/backend based on those checkboxes). It can be all a bit confusing which is why I am contemplating removing the Detect mode option and maybe even making the "Output Mode" panel one of the defaults when Tracy is installed. If anyone has any thoughts on improved behavior, I am all ears!
×
×
  • Create New...