Jump to content

Bill C

Members
  • Posts

    42
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Bill C

  1. Hello, I upgraded to 3.0.18. I did the upgrade by updating the wire folder, index.php and .htaccess. When I go to vew any of the site pages, I am seeing the two lines listed below. compile(\ProcessWire\wire("config")->paths->root . 'site/templates/header.php' ,array('includes'=>true,'namespace'=>true,'modules'=>true,'skipIfNamespace'=>true)))?> I tried to find an answer for this but was not successful. If anyone can help or make a suggestion, it would be appreciated. Thanks.
  2. Bill C

    Debugging tips

    Hi kongondo, Very important update : This module will not work in Processwire 3.0. Main reason being there is no 'namespace Processwire;' in the source., sorry. The module DOES work on 2.7.2. but no dice on 3.0.18. I just happened to update my dev site to 3.0.18 this morning and in the course of doing so, I hit this problem because of the lack of a PW namespace in the module. After adding it, still getting an error on one of the methods that uses Reflectionclass. I am going to try to sort this out. When it's done, I'll let you know. Thanks. =============================================================================================================== update part 2 : I have the module working in PW 3.0.18 now. This has been a learning experience on namespaces. A few problems came up fixing the module, that I resolved, I need to go back and test a bit before I post anything here. This link helped explain what the problem was with trying to instantiate a Reflectionclass object : <http://php.net/manual/en/language.namespaces.fallback.php> The fix was to prefix the classname with a backslash. So changing this line within the FirePhp class : $reflectionClass = new ReflectionClass($class); to this : $reflectionClass = new \ReflectionClass($class);, solved that problem. I want to look into this further. Once I'm comfortable with the fixes, I will update the zip I created. Thanks. update part 3: The dropbox link for updated version https://www.dropbox.com/s/wdhxy1ke1z4rm25/firebugMod_V2.zip?dl=0 ================================================================================================================ Original post before the fun began: Here's the dropbox link to the zip file I put together. - https://www.dropbox.com/home?preview=firebugMod.7z I'm on Windows. I created the zip with 7-zip. I hope that doesn't pose a problem. If it does, let me know please. I did try to make the code a little more presentable. PSR compliant? Probably not but close? lol The zip includes a few things other than the module itself, which I thought my be helpful. 1) There's a read me file of course. It explains how to set up the module. I'm sure you don't need help I wrote it up anyway 2). There's some uber simple examples of calls to the module which I think hit every available function in the module. The module does NOT provide calls for every available feature of Firebug or Firephp, but I do think I included code for the most used functions. 3). There's some example screen prints of the output on the Firefox console. 4) and Last but not Least, there's the Firebug and FirePhp library files which the module pulls in of course. I saved you the trouble of downloading them yourself. I believe they are the most recent versions. I'm on Firefox 46.0.1. I have Firebug 2.0.16 and Firephp 0.7.4.1-signed.1-signed. I'm not super techy when it comes to Firefox add ons. My concern is how the code with behave if you're not on the same versions. I guess we'll see. I am hoping there won't be issues. I think that is it. Thanks for the interest and have a good one.
  3. Bill C

    Debugging tips

    Hahaha.. good one! I'll move it up on the list then Thanks Adrian! Appreciate the tip. Have a good one. Hi. Word has it you'do be much happier with the Tracy debugger, but sure if you'd like the code I'll write something up and get it to you. Thanks.
  4. Bill C

    Debugging tips

    I have put Tracy Debugger on my list of things to look over soon. In the meantime I just use Xdebug usually. Depends on what I'm doing. I got burnt big time the other day by throwing a quickie echo statement in a piece of code which in turn messed up an Ajax call which in turn screwed up the Admin Page tree. LoL. So I took a very simple wrapper class I wrote to help with debugging. It's a simple wrapper for the FirePhp class. I took it and created a quick and dirty PW module out of it. So everything goes to the Firebug console in Firefox. The code is just taking the array passed to it and doing var_exports on each element in the array. It can also be used to call Firebug's trace function. Nothing fancy, crude, I know. I reinvented the wheel there but it didn't take very long to do. I had the code already more or less. I think it would have taken longer to uses someone else's and get familiar with it. Sample code for using it: $module = $wire->modules->get("FirePhpBC"); $t1=55.12; $module->fireLog(array('Joe',$t1)); $module->trace("i`m here."); And lastly, more preaching to the choir with this wiki article https://en.wikipedia.org/wiki/Defensive_programming 'Defensive programming' I think it is part science, part gut feel. I think the same holds true for debugging. I think you can get a little obsessive with defensive coding and waste a lot of time checking for ghosts. The article mentions this also. Like everything else, it only helps if you put it to practice. Obviously .. better code... fewer bugs. And another thing I try to avoid is writing large chunks of code without testing and I also try to modularize and reuse..'Separation of Concerns' . Again.. preaching to the choir. Anyway.. enough .. I'm trying to keep my posts to a reasonable limit. lol. Have a good one..
  5. Even though I really don't know Renobird or LostKobrakai I would still like to extend a word of thanks for their hard work and the time they put in to make things happen and get stuff done. Congratulations on the roll out. Nicely done.
  6. Hey.... I figured it out. It was an echo statement messing up the buffer, in turn causing the Ajax call in ProcessPageList.js to fail. Just shoot me. Apologies to anyone who spent time looking at the post. And I just advanced to junior member too lol Have a good one..
  7. Me again.. I forgot this tidbit ... I'm using ProcessWire 2.7.2 . Thanks again!
  8. Hi, Looks like my Processwire honeymoon is over. I am having trouble logging in to the Admin page. I'm getting a very unhelpful 'Unknown error, please try again later' message. I looked in each of the log files under site\assets\logs and I'm not seeing anything helpful. Looks like the error is coming from a ProcessPageList module - Here's the line of code with the error message being passed to the module 'ajaxUnknownError' => $this->_('Unknown error, please try again later'), // Unknown error during AJAX request. I am not getting booted out completely from the site, but if I click on 'Admin' it throws the error again. So the problem does seem to tie into the 'ProcessPageList' module, reason being, I have no tree list of pages under Admin. lol This problem isn't affecting my worklife, so no pressure. I know I could just do a reinstall and call it a day, but I'd LOVE to know what the cause is here. I just thought I'd try you guys and girls first before I start banging my head against the wall with Netbeans and firebug, etc. I can not think of anything I could have been doing that would have ruined the PW party for me. The next time I logged out and tried to log back in, no dice. I get the above mentioned error. If anyone happens to be familiar with these symptoms or can suggest something I should check, that would be appreciated. I tried a little Googling but was not able to come up with anything substantial. Usually my Googling skills serve me well but we all have off days. Maybe I'm just missing something. At the least though, I think that this should be noted somewhere. The fact that nothing is getting out to any of the log files mentioned is a little cause for concern? But on the other hand, the error message itself starting with 'Unknown error' though kinda leads me to think that whatever is tripping things up is not something that can not be identified or not easily? Better to label it 'Unknown' than to mislead? Just guessing.. I know stuff happens and today was just my turn. Final recap. I am using PW on my desktop. ( no laughing ) I am on Windows 10. I am using WAMP. I have not installed anything new today. Everything's been fine the last few days. Was smooth sailing in the morning. I have cleared cache. I rebooted. Windows threw me an update on the first reboot, but the problem occurred before the first reboot. Don't see anything in the Apache error log. Attached a snippet from the Apache access log. Don't know if the messages are significant or not. I see same from yesterday when there was no problem. And again, no one needs to go out of their way on this. I was just wondering if anyone else had hit it before. Thank you for reading all this. apacheAccessLog.txt
  9. Hi Arturg, I don't know if you were able to get your code working or not. LostKobrakai's suggestion is very solid of course. I just thought this link to good old StackOverflow might also help you see why the code you posted will only pick up one file. http://stackoverflow.com/questions/5444827/how-do-you-loop-through-files-array Search for the answer given by Decent Dabbler . I think his or her answer would be the easiest to adapt to your code to get it working. Basically the problem with the code you posted is that it isn't iterating through the $_FILES array. As you said, it's working for one file, so wrapping it in a foreach loop, as done in the example should fix things up for you. Throwing out advice like this in a forum is new to me. I've never participated in a forum before. I hope what I've posted is of some additional help. It keeps me out of trouble. Have a good one...
  10. Hello am*, welcome You have probably already noticed the 'Modules' section on the site. I am rather new here myself. I just wanted to point out that you will find a category of modules referred to as 'Users and Access'. I think that if you are going to be developing a site that requires user management, you will find some modules in that section that you may find very helpful in giving your development a little jumpstart. And that's only one category of modules, you will of course see the others that may contain code that you can incorporate into your site. There are tutorials to help you understand how modules are used in Processwire. You definitely want to browse through the tutorial section. Well, not just browse... you know what I mean. Get a grip on the template concept in Processwire, especially 'selectors'. Selectors are big. Anyway, I think you will be further impressed by Processwire and has others have said, this is a great community here. Very active, very helpful, very talented. Have a good day and best wishes with your site development. Oh, one last little tip for you. Actually I picked this up here from one of the threads in the forum and thanks again to the person who posted it!. You may have better results if you use Google to search the forums. Here's an example. Plug this into Google's search box ' site:https://processwire.com/talk/ user management ' Here's another that pertains to your questions ' site:https://processwire.com/talk/ table design '. Anyway, before I get too carried away and create another tl;dr type post. Enjoy!
  11. Hey Pwired, thanks for taking the time to post your compliment and reply. Hope all is well in Spain. Your reply brings up more than one issue that I've been thinking about on and off for a while now. As I mentioned in my post, I'm not building sites for a living at the moment. At best I hope it is to become a part time endeavor. How realistic is that goal? I'm not too sure at the moment. I'm one of those 'old programmers' you hear about sometimes Some may laugh, and that's ok.. but I still enjoy creating software and learning new things, though I try to pick and choose wisely what I put my time into. I did spend a more than a few weeks of evenings experimenting with Wordpress after looking into it , seeing the numbers which are hard to ignore, on it's usage and popularity, etc.I was at a point where I was able to put a decent template together from scratch and I was starting to feel comfortable with the Wordpress flow. Ultimately though, I did not really enjoy working with it. It was not easy to pass on it after the time I spent on it. Sometimes you do have to invest more time than anticipated to evaluate a piece of software, especially a 'framework'. And yes I know , many don't consider Wordpress a framework or a CMS. I'm not big on semantics so forgive me ( Interesting read here on that topic if you're interested ) One of the priorities for me personally is, if I'm not enjoying what I'm working with, I'll pass on it for now. I feel much more positive about working with PW than I did with Wordpress. The code/design is MUCH easier to follow for me personally. My hat is off to Mr. Cramer and the others closely involved with development and maintenance. I'm not saying Wordpress is garbage. I'm just saying I have more respect for the internals of PW vs Wordpress. Again, not claiming to be an expert on these things, it's just my personal feeling about the matter. I would be interested, for my own benefit to see an example of what you mean by the more recent versions of PW requiring more code to accomplish a given task. Yes, I can see where a site could be put together faster with Wordpress than with PW. I would guess we're talking about relatively simple sites though? And really, who puts together a site from scratch anyway? It's not difficult to see that PW very much lends itself to creating site templates and yes it can be done with WP too, but which would be easier to implement with a satisfactory degree of flexibility? I personally feel that PW's whole Page->Template-Field concept provides great flexibility. Now I realize that WP may have plugins / themes that offer similar flexibilty. I am just not familiar with them personally. And yes, it can't be argued, Wordpress users have a huge number of plugins at their disposal and this of course might give them the edge in development speed if a similar plugin isn't available for PW. Anyway, as usual, I have rambled enough. Another fine example of tl;dr I'm afraid. Worried I might be banned from submitting posts after this. The scary part is I had more to add, but I will just save the thoughts for a post of my own sometime. Again, thank you again for taking the time to reply. On a parting note, I will only add 'Raise your rates!!' ... ( just joking.. sort of.. Have a good day.
  12. I think this thread is classic and I'm glad I stumbled upon it. A lot of grins and nods while reading through it. It touches upon many points of frustration that any coder, no matter what the platform , is going to run into. Speaking from my own experience, as the cliche states, there are only so many hours in a day. Only you can make the decision how you want to spend them. OK.. so a little background... I am not a full time web developer at the moment. I was a full time developer for many years up until recently, working on different platforms along the way - IBM mainframe , HP, Unix and of course Windows. I have had the great pleasure of learning more than one language that eventually fell to the wayside for one of many possible reasons ( Powerbuilder anyone? ). Of course I had to put the time into learning those languages. I am not bitter though After you've been a coder for even a short time, you come to see this is just the nature of the beast and I don't consider it time wasted. It kept me employed . On the other hand, if you value your time, you learn to sit back and ask yourself, do I really need to use this? Is the benefit I get from learning it going to outweigh the time and effort to learn it? Does this seem to be a product that will be around for a while or is it the product of some talented individual(s) making a go at becoming the next Zuckerburg? Maybe they will and maybe they won't. These are just a few questions I think most of us ask ourselves before we go off on a tangent to learn yet another piece of software. Case in point regarding this article : Grunt vs. Gulp. On many occasions I came across many threads where either of the two happened to be mentioned but I held back from taking the first step. I had other priorities at the time ( Like looking over PW for instance ). My first exposure to either came this weekend. I did some Googling and read enough to get the impression that more than a few people switched from Grunt to Gulp. Ok so I read a little more and got the second impression that it might not have much of a learning curve. So then I ask, could I get by without it? The answer was yes, I could simply write a PHP script or even vbscript for that matter, that would accomplish what I needed. I was a little conflicted because I saw some potential benefits with learning to use it. Just small conveniences, nothing major. I also had the suspicion that I could probably find enough sample code to throw together what I was looking to accomplish with it, and sure enough, that was the case. This is just a small example, there wasn't much at stake with playing around with Gulp, and along the way I learned a few small things about Node.js. I am a Node newbie, so it's all good. I have written way more than enough here and see that I have not really made any specific point, and I've just reiterated points already made by others. To summarize it, I'd say choose your battles wisely. Don't lose sight of your current priorities. Weigh the potential advantages against the potential time investment. And also, are you willing to put software package 'A' on maintenance mode in order to take on the new, shiny product 'B'? Have a good day
  13. Hi, Please don't hate on me but I'd also like to mention Visual Studio Code. I vaguely remember checking it out quickly a while ago and wasn't too impressed. I came across a reference to it this weekend while reading a thread concerning Gulp. ( Don't ask ) so I decided to take another quick look. I've installed it and have been using it not even two days. I like it a lot for what it is and will probably stick with it.It's more geared for developing HTML, CSS, Javascrpt and Node but it does have extensions for PHP and it hooks up to xdebug very easily. It's got some features that I think will be time savers, once I get used to them. I've been using NPP for quite a while and have no complaints with it, and I finally have a pC that can handle Netbeans easily enough. My method has always been to use NPP first for straight coding, and break out Netbeans when I need to really study code I'm not familiar with. I have briefly looked at Atom, Brackets and ST3. They are obviously all good products. So many editors (and CMSs, and Javascript frameworks, and CSS frameworks and...) , so little time. For me personally, I was comfortable with VCS from the get go and I'm guessing it might be in the same league as the others. I want to think that any missing and desirable feature will eventually be provided by some 3rd party extension. Wishful thinking perhaps. Extensions are written in javascript, and the means exist to create them on your own if you choose. Anyway, I didn't want this to turn into a commercial. Just wanted to mention it after having rediscovered it this weekend.
  14. From a noob on the outside looking in, I feel a need to state the obvious. I have been spending a fair amount of my time lately installing and working with a few of the 'popular' CMS offerings. I haven't honestly decided what product I'm going to go with yet. For the type of sites I hope to be doing, PW might be overkill. But that's off topic here. Just speaking from my own observations so far.... The Processwire forums and community easily outshines the others ... overwhelmingly. I am not going to name names and I'm just guessing that the accompanying argument from the competition would be something like 'Well , there's only so many hours in a day, and we're a small group of developers with other jobs, family , etc , so whatever time we can spare, we put it into development , patching, etc.'. And that argument is a completely valid one. The point is though, that it appears a number of people involved with PW, with I'm sure the same obligations, ARE taking the time to make the community here what it is - very knowledgeable , very friendly and VERY valuable to those who otherwise might be Googling for hours on end looking for a solution, and we all know how much fun that can be. Well maybe not all of us, but I know I have been there on more than one occasion because the so called documentation was outdated, couldn't find an answer in the 'forum' and I wasn't in the mood to walk through the code with XDebug that day. Anyway, I have rambled enough. Thanks again to ALL. You ALL have a GREAT community here.
  15. Beluga thank you for the reply which prompted me to take a closer look into SASS and SCSS. I had seen the *.scss files in some of the PW folders, such as \wamp\www\PW\wire\modules\AdminTheme\AdminThemeDefault\styles\sass and came to the conclusion that they are files for Sass based on the name of the last node of the path. And I'm seeing , for example a file named main-futura.scss in the sass folder and a main-futura.css in the styles folder above it. I did some more looking around and came across this web page : https://responsivedesign.is/articles/difference-between-sass-and-scss. As I mentioned in my first post whether it's SASS or SCSS, both are new to me and I do intend to look into them further at some point. I realize that if I want to customize a theme, using sass or scss isn't mandatory. Again, thank you for your comment.
  16. I can see the post is a couple of years old but I just wanted to say thanks to those who posted their replys. I am new to PW and at the moment I'm trying to stay focused on getting up to speed on it. On top of learning PW I see it might be a good idea to at least learn some Sass basics, seeing that PW is using it. First things first though.
×
×
  • Create New...