celfred

Members
  • Content Count

    137
  • Joined

  • Last visited

Community Reputation

56 Excellent

About celfred

  • Rank
    Sr. Member

Contact Methods

  • Website URL
    https://planetalert.tuxfamily.org

Profile Information

  • Gender
    Male
  • Location
    France

Recent Profile Visitors

3,907 profile views
  1. Hello, I'm facing an issue trying to restrict access to a field so front-end edition is possible in an easy manner for the user. Let me explain : I have a field 'group' which is a Page list of group names. I want the user to be able to front-end edit a 'player' page in which this group field appears. I'd like the user to have a list of groups limited to his or her own groups (so he or she doesn't see all groups created by other users). In the back-end, I use this selector string : template=group, created_users_id=[user], sort=title This works great ! BUT here's my issue : If I back-end edit a 'player' page as 'Admin', the 'group' is empty (since admin is not the created-users-id and the group field is then empty... In other words, I must choose between all groups shown to all users (which may be scary for a user having only 2 or 3 groups whena list of 60 shows up) OR having a correct list for the front-end user, but empty for the back-end 'admin'. Can anyone think of another way I could get the expected result ? I have a feeling the simplest way would be to have a "Ignore for superusers" checkbox next to the 'selector string'. Thanks !
  2. @jmartsch Thanks a lot for your help ! It works now ! But one thing worth mentionning : I was on a 'Page List Select' and it wasn't working, until I found out I had to use the 'Select' type of field
  3. Hello, I'm struggling with this : a 'group' field of 'Page' type. The parent of selectable pages is '/groups', the template is 'group', and a member can create some groups in the /groups tree. I would like this user to see only the groups he or she has created so in my 'Find selector' in the backend, I would like to use : template=group, created_users_id=$user->id But that doesn't seem to work... I still get the list of all available groups in the /groups tree. Any idea ? I had a feeling I had already seen that before (something like $user->id must be replaced by users_id or something, but I can't find anything in the Forums... and all my tests keep failing...
  4. celfred

    Perfect ! It works ! Thanks a lot !
  5. 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.
  6. 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...
  7. 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
  8. 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.
  9. 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 !
  10. 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 !
  11. 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 ?
  12. 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 !
  13. 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 !
  14. @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
  15. 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.