Jump to content

ttttim

Members
  • Posts

    61
  • Joined

  • Last visited

Posts posted by ttttim

  1. I'm having some problems on a website of mine when using the clone option. The page has a Repeatermatrix field with a few options like image/text/etc. The problem seems to be copying the image as I'm seeing 2 errors in the logs:

    Image-Sizer: Original image does not exist to create size variation and Exceptions: DirectoryIterator::__construct(/site/assets/files/10187/): Could not open directory: File or folder does not exist

    The page is copied, the repeater items are copied, but only up to the first image item. The image field inside the repeater contains an empty image. And the repeater items after that image are ignored. 

    When testing locally I have no problems at all. I've changed the image files to see if there was an error with a specific file, but that doesn't resolve anything. Does anyone have any idea where to look next?

    PW version 3.0.229 / PHP 8.2.13

  2. I've been encountering frequent Error in hnsmtp::send : cannot connect to smtp-server! errors indicating a failure to connect to the SMTP server. I'm using Brevo, formerly known as SendinBlue, and this issue only started a few months ago. The errors seem to occur randomly, with varying frequency, ranging from ten times a day to once a week. I've reached out to Brevo for assistance, but they haven't identified any issues so far.

    Additionally, I recently conducted an external SMTP test on dnschecker.org, and it consistently succeeded each time (though this might be coincidental). The problem persists regardless of whether I test the connection locally or in a live environment.

    I'm wondering if there's a way to debug the SMTP connection to gather more information about the problem.

    • Thanks 1
  3. The weird part is that i have so far 3 website's that are facing these problems. And not just on my computer but clients had the same problems. The steps i already took:

    • Use:  $config->sessionFingerprint = false;
    • Use: Session Handler Database
    • Clear: cookies and cache
    • Disable: all module

    Other website's with the same PW version are not having any trouble. The hard part is that i can't find any errors in the logs. The logs are not recording the loggin out. Debug isn't giving any error i'm simply just logged out. The Randomness drives me a bit crazy. Anyone has any leads to vinding the issue?

     

     

  4. @ryan Browsing private does seem to fix the issue, but deleting all cache and cookies for normal browsing does not. 

    Setting the sessionFingerprint to false doesn't work. The problem only seem to kick in ben loading data with Ajax so loading pages, repeaters and modals.

  5. I've recently updated my MacBook but now safari keeps logging out the CMS. And most of the times after trying to log back in i get an error This request was aborted because it appears to be forged. The session log is not reporting the logout so I suspect it has something to do with safari not reading the session files? 

    Anybody got a workaround?

     

  6. You can do this with a little bit of extra CSS. This example is what i use for a radio select

    .Inputfield_select_option input + .pw-no-select {
      position: relative;
      padding-top: 70px;
      margin-bottom: 20px;
      width: 100%;
      display: inline-block;
      text-align: center;
      color: #333;
      font-size: 14px;
      cursor: pointer;
    }
    
    .Inputfield_select_option input + .pw-no-select::before {
      content: "";
      position: absolute;
      width: 100%;
      height: 50px;
      top: 0;
      left: 0;
      display: inline-block;
      background-size: contain;
      background-position: center;
      background-repeat: no-repeat;
      border: #d9e1ea 1px solid;
      border-radius: 3px;
      margin-bottom: 5px;
    }
    
    .Inputfield_select_option input:checked + .pw-no-select::before {
      border: #2a2a2b 2px solid;
    }
    
    #Inputfield_select_option_1 + .pw-no-select::before {
      background-image: url(images/option1.png);
    }
    #Inputfield_select_option_2 + .pw-no-select::before {
      background-image: url(images/option2.png);
    }
    #Inputfield_select_option_3 + .pw-no-select::before {
      background-image: url(images/option3.png);
    }

    To add a custom CSS the link below shows one way of doing so.

    • Like 2
    • Thanks 1
  7.  

    For step 4 you could also create copy of your config.php file called config-dev.php to have different config/database settings on your local site. And if your using Git you can easily ignore the config-dev file so local settings it won't end op on your repo. 

    1 hour ago, Stefanowitsch said:

    That is the usual way I do it (and I think most of developers do):

    1. Export your local database
    2. Create a new (empty) database on your live server and import the database there
    3. Upload all project data from your local directory to the live server via FTP
    4. Adjust the config files for the new database connection
    5. Testing with debug mode enabled

     

  8. I have an application running which every night imports/update data from an API. Below is a sort of summary about the code:

    $data = callApi($urL); //returns all the course id's 
    
    for ($i=0; $i<count($data); $i++) {
        $id = $data[$i]->id;
      	
      	//for every id do an extra api call to get detailed information.
      	$course_data = callApi($url, $id); 
      
      	//get course page or create a new page
      
      	//update fields if data has changed
    }

    The API doesn't return a timestamp for changes so i can't check if there has been updates since the last import. Meaning i have to make an API call for every course to get the detailed information and have to loop through every field to see if something has changed. The code works fine but the problem is that i often get a 504 Gateway Time-out because the script is taking to long...

    Is there a way to run the code in the background or is my only option to increase the max_execution_time?

  9. When using the autocomplete field i get a JS 403 error You do not have permission to access this document.

    Anyone else got this error? 

    UPDATE

    When checking the hosting i get the following warnings COMODO WAF: URL Encoding Abuse Attack Attempt / Invalid URL Encoding: Non-hexadecimal digits used at REQUEST_URI

    SOLVED!

    The problem was caused by using %= as search operator when switching to *= it worked again.

     

  10. I love the module! 

    I was wondering how do you handle creating a page reference field when the templates and pages are created in the same migration. Because you don't know the id's yet.

    'fields' => [
    	'pageSelect' => [
    		'type' => 'page',
            'template_id' => XX, //template ID (foo-template to be created)
            'parent_id' => XX // Parent ID (parent-foo to be created),
            'inputfield' => 'InputfieldAsmSelect',
     	],
     ],
    
    'templates' => [
        'foo-template',
    	'parent-foo-template',
     ],

     

    • Like 1
  11. Hi i've recently changed a bulk of pages using the API for name-id to name-lastname. Only to notice that all the old URL don't work anymore even though the module was installed. 

    Is there a way to add to loop through the pages and set a custom redirect through the API? something like below (of course not a correct code)?

    foreach($team as $team_member){
    	$team_member->redirect($team_member-name.'-'.$team-member->id);
    }

     

  12. In your JS you're adding/removing the class w3-show but in your CSS your class is .show. Does your .column has

    display:none 

    This is used to hide all elements and only show the elements containing .show. Also make sure your .show class is beneath your .column class to override the display setting

  13. Hi @BillH

    Thanks for your reply. In the post you've mentioned the time is not relevant where in my case the date isn't relevant just the time. I believe that in php time is always connected to a date that's why i'm not sure how to use the selector just for time. 

    My alternative is to create an extra field in the back-end which will hold a string like '930' for 9:30 etc. But this seems like an ugly work around. 

  14. I'm building a filter system for courses where users can select a start and end time and I want to get all the courses within the selected time window. In the backend I have two datetime fields that holds the time. The filtered time is a string like '11:15'. To what do I convert the string to be used in a selector:

    start_time>=$startTimeString, start_time<=$endTimeString, end_time>=$startTimeString, end_time<=$endTimeString

    And do I need to set the Time Output Format?

  15. I'm using a Select Option field for a user to select a color by name. In the back-end the radio buttons are showing the title of the color but the actual value (the Hex) can't be traced using the Inspector. Is there a way to hook into the Radio input field to add the Hex value if one is selected? I'd like to add the selected color to the background of the field after save.

  16. I was recently experimenting with optimizing my images to get better load results. The code below is an example of what i've been using. It works nicely but the main problem is if i load a page for the first time after having added a few images my server will overload and return a 503 error. I have to refresh the page a few times for the server to resize all the images. Not a big problem while developing but not something I want on my live website. 

    <picture>
    	<source media='(max-width: 320px)' srcset='{$image->width(320)->url} 1x, {$image->width(640)->url} 2x'>
    	<source media='(max-width: 375px)' srcset='{$image->width(375)->url} 1x, {$image->width(750)->url} 2x'>
    	<source media='(max-width: 767px)' srcset='{$image->width(750)->url} 1x, {$image->width(1500)->url} 2x'>
    	<source media='(max-width: 1023px)' srcset='{$image->width(300)->url} 1x, {$image->width(600)->url} 2x'>
    	<source media='(max-width: 1319px)' srcset='{$image->width(450)->url} 1x, {$image->width(900)->url} 2x'>
    	<source media='(min-width: 1320px)' srcset='{$image->width(510)->url} 1x, {$image->width(1020)->url} 2x'>
    	<img src='{$image->width(1056)->url}' alt='$image->description'>
    </picture>";

    Is there a way to create these different sizes without overloading my server? 

    Ideally i'd like to expand the above code with webp support and a service like tinyPNG to reduce image size even further, but that would stretch the first load time even further. 

×
×
  • Create New...