• Content Count

  • Joined

  • Last visited

Community Reputation

56 Excellent

About celfred

  • Rank
    Sr. Member

Profile Information

  • Gender
  • Location

Recent Profile Visitors

3,809 profile views
  1. celfred

    Perfect ! It works ! Thanks a lot !
  2. celfred

    @adrian I was indeed about to tell you I'm updating from... 3.6.9 ! I managed to get back the old version from my remote site). So far, I've tried what you said : Starting with a 'regular' update trhough the module page, clicking on update. It detects the 4?15.4 version. It downloads and then still triggers the same error. Then, I went to check the cookies. I couldn't find the TracyPanelSticky you mentionned, but trying to erase all Tracy cookies (and eventually deleting all my localhost cookies), and also deleting the TracyDebugger folder in my modules folder, and deleting the TracyDebugger folder in my assets/cache/Filecompiler/site/modules... still the same result In short, I have deleted all traces I could find of TracyDebugger and tried re-installing 4.15.4 but the error persists. You were perfectly right about the 'sticky panel' : I remember I had the var-dump panel sticky before updating. Thanks a lot for your help.
  3. celfred

    @adrian : Well, I am upgrading through Setup > Modules > New and I type the className. Everything downloads and then I click 'Install now'. I've checked the path and no, the file doesn't exist. I've tried the Modules > Refresh and re-installed Tracydebugger : same problem. Here's the line mentionned that triggers the issue : File: .../modules/TracyDebugger/TracyDebugger.module.php:1341 Thanks for your quick reply. Edit : I've checked on Github in panels folder, and there is no TemplateEditorPanel.php file... I really don't get it...
  4. celfred

    Hello to all, I've just tried updating the module and got an error. I then deleted it completely to start all over again (on my local site), and as soon as it is downloaded, even if I choose to leave it uninstalled, I still have the same fatal error (I must delete the TracyDebugger folder in my modules completely to be able to access my site). Here's the error : require_once(): Failed opening required '/home/celfred/PlanetAlert/site/modules/TracyDebugger/panels/TemplateEditorPanel.php' (include_path='.:/usr/share/php') And I'm sorry to say I have no idea what to do... So if one of you could give me a hint, that would be great. I was using TracyDebugger more and more (for minor debugging, I guess you can tell from my question) but I would like to use it more
  5. celfred

    Well that's a great answer ! Thanks a lot @Robin S I was completely unaware of the distinction and your explanation is perfect. I had to struggle with similar issues before and that's quite a step forward for me. Thanks ! I'm gonna take some time to think about all this and read over my code.
  6. celfred

    Hello, I'm facing a weird behavior (to me)... Why are these requests not returning the same values ? // Test 01 : not working > returns empty $allPlayers = $pages->find("team=$team"); // Returns the 10 players (1 of them has HP=14, others have HP>15, no players have coma=1) $dangerPlayers = $allPlayers->find("(HP<=15), (coma=1)")->sort("coma, HP"); // Returns nothing ??? // Test 02 : Working as expected $dangerPlayers = $pages->find("parent.name=players, team=$team, (HP<=15), (coma=1)")->sort("coma, HP"); // Returns the low HP player If you can explain this to me, I would appreciate because this is causing me a headache right now Thanks !
  7. celfred

    Thanks a lot for your quick help. But I'm not that good and I am running PW 3.0.62 both on local and production. I won't update right now because I'm not able to easily manage different version on local and remote... So I'll manage little by little and do the update later But thanks !
  8. celfred

    Hello, I am discovering PHP tests and this great module (thanks !). Just to mention in case it helps others. The first example kept failing on my website until I understood it was due to the multilanguage setup. Eventually, test 01 became : public function testHomeTitle() { $expected = 'Home'; // we expect the page title to be "Home" $actual = wire('pages')->get(1)->title->getLanguageValue("default"); // check what's the actual title Assert::equal($expected, $actual); // check whether they are equal } and passed This may seem perfectly obvious to most of you, but it might help a few ? By the way, I wish I could use my usual debugging tools to debug my tests (sounds quite funny to say ) and write something like bd($actual); Here I had to fiddle until I found out about my multiLanguage thing... Would you have any tips on that ?
  9. Thanks a lot for your explanation. I understand things better now I've just tested and made sure my cache was up to date, but no change... What's surprising is that with the initial config, I tested somewhere else on my site and it worked. Of course, I double-checked all permissions for the template I'm trying to have the 'Edit' button for... and I'm testing only as a superuser. So that's still a bit myserious to me. But since the problem doesn't occur somewhere else, I guess I AM the culprit who messes things up. That's not a big deal either. I'll do more testing and come back here if I find an explanation. Thanks for your help !
  10. Hello, Another question I have, related not only to FEEL module, but I'm facing it with it so here it is : I load a page via ajax. In the loaded page, I would like to have a $page->feel() to have my front-end link, but the result is nothing. I thought having namespace ProcessWire; at the top of my ajax-loaded page would do the trick, but it doesn't... Does anyone know what I should do ? Thanks !
  11. @tpr Thanks for your quick reply, but with no luck.. I had tried to set the 'user-admin' permission to the 'teacher' role (and I'm trying again right now), but still no Edit link appearing. If I set 'superuser' role back, the link comes back... Another idea ? More info : if I try to front-end edit using the built-in PW capabilities method D gives the same result : not editable even though I'm setting all permissions like superuser's permissions, but editable by double-clicking if I add the 'superuser' role to my 'teacher'. I just don't get it... EDIT : As a follow-up, I have applied a workaround : building a linked page to my user (with a specific editable template) and behavior is now as expected... I should dig a little for the 'official' user profile page front-end edit, but I am not a 'superuser' myself
  12. Hi, I'm struggling with something : My 'user' template has page-edit permission for my 'teacher' role My 'teacher' role has page-edit, page-edit-front and profile-edit permissions And yet if I type $user->feel() in my template page (while logged as a 'teacher' user), I get nothing If I add 'superuser' role to my logged-in teacher, I get the 'Edit' link. I thought $user were behaving like regular pages... So I've been looking thorugh all my permissions roles for hours but I can't get it to work... I'm lost... Maybe $user is not possible in this context ? If anyone has an idea on where I could look or can explain what's going on here, I'd appreciate.
  13. celfred

    Hey, Sorry to come back on this, but I'm still struggling... Why is this working as expected ? $notTeacherActions = $pages->find("template=task, owner.singleTeacher=$user"); // Returns 2 pages having the $user in the owner repeater singleTeacher field Whereas this is not : $notTeacherActions = $pages->find("template=task, owner.singleTeacher!=$user"); // Returns nothing where it should return all tasks NOT having this particular user in the singleTeacher owner repeater ? I have a feeling this has to do with my misunderstanding in the previous posts... So I continue here By the way, still in this issue, I'm stuck with : $globalActions = $pages->get("name=tasks")->children(); // I have 62 tasks pages $adminActions = $globalActions->find("adminOnly=1"); // I have 10 adminActions $allActions = $globalActions->find("adminOnly=0"); // I have 45 non admin (available to the logged-in user bd($allActions->count()); // This shows me the 45 // The following are my tests to understand... Which I don't :( // First tests from $pages $teacherActions = $pages->get("name=tasks")->children("owner.singleTeacher=$user"); // This returns 2 $notTeacherActions = $pages->find("template=task, owner.singleTeacher!=$user"); // This returns nothing... $notTeacherActions = $pages->get("name=tasks")->children("adminOnly=0")->not("owner.singleTeacher=$user")->sort("category.title"); // This actually returns 45 ($allActions, including the 2 returned in $teacherActions...) bd('from $pages:'.$teacherActions->count().'/'.$notTeacherActions->count()); // I get 2 and 45 // Second test from $allActions // THIS SEEMS LINKED TO MY ORIGINAL REQUEST (AND I'M STILL LOST !) $teacherActions = $allActions->find("owner.singleTeacher=$user"); $notTeacherActions = $allActions->not("owner.singleTeacher=$user")->sort("category.title"); bd('from $allActions:'.$teacherActions->count().'/'.$notTeacherActions->count()); // Returns 0 and 45 As you can see, I still have a long way to go tu understand all this... Sorry if I'm being hard to follow, but I am indeed confused on this issue...
  14. celfred

    I'm starting understanding things better Thanks a lot for this helpul answer ! I'll keep exploring to build a better knowledge of what I'm doing exactly.
  15. Hello, Another newbie question. My Processwire sites is growing and I'm wondering if my way of doing things sounds goog to you. I tend to avoid what I consider 'heavy and frequent' database requests in my functions. For example : // In functions.php myfunction($player) { wire('$pages')->find("myselectors"); // This means about 300 database requests do something... (like $p->newTmpField = 1;) return $player; } // In template.php $allPlayers = $pages->find("template=player"); // About 300 players foreach ($allPlayers as $p) { myfunction($p); } // Now I have access to newTmpField, for example. I tend to replace with : // In function.php myfunction($allPlayers) { foreach($allPlayers as $p) { // do something like set $p->newTmpField = 1 } return $allPlayers; } // In template.php $allPlayers = $pages->find("template=player"); myfunction($allPlayers); // Now $players have been modified. For example, I have $allPlayer->find("newTmpField=1"); So for the moment, I tend to choose the second solution which makes only 1 database request, but what do more experimented developers would recommend ? What I find useful with Page objects in functons arguments is that I have the whole 'tree' I can then 'find' in my function. But as you can see, I need to understand things better. I have a feeling my 'practical' explanation is not really convincing Thanks if someone can take a few minutes to give me advice !