-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
I don't know the PageTable field, but ... there are settings which lets you decide what to do when a (language supported) field (or page?) is empty: don't show or inherit default. This is in PW since 2013 or version 2.4. If it is explicitly with a single field that should be excluded if blank (and there is no setting what to do on empty languages), but the rest of the page should be rendered, at least one can define that in the rendering template file: <pseudo-code> If language not is default AND field is empty: skip output </pseudo-code>
- 1 reply
-
- 1
-
- languagesupport
- pagetable
-
(and 1 more)
Tagged with:
-
-
https://processwire.com/docs/selectors/operators/ https://processwire.com/docs/selectors/ https://cheatsheet.processwire.com/selectors/ id!=1234, id!=2345
-
? sounds good! ? All the best for you! ???
-
InputfieldURL: link: Note that "http://" was added
horst replied to Robert Zelník's topic in Wishlist & Roadmap
In general I would say yes. But there may be a chance you have a link pointing to a none https domain that then will fail. Using http with a https domain should work. (Often the servers forward them to https). -
Possible to show more pages in admin before it shows more button?
horst replied to joer80's topic in General Support
-
Finally I got my local setup switched today. PHP 8 which needed a new apache version too, and then SSL needs to be updated, etc., etc., ... Now I need to upgrade my IDE for PHP 8 support too. ? After all I could debug and correct the WireMail-SMTP module: https://github.com/horst-n/WireMailSmtp
-
HI @eelkenet, I have setup a new test site today and it looks that any possible setting is working as expected from the PW image generation site. So it seems I need some more information from your setup. Especially this: what settings are you using for $config->imageSizerOptions ? what are the settings for $config->webpOptions ? how do you call the image url in your template file(s) with $image->size()->webp->url or $image->size()->url, or how? do you use an individually passed options array there? what are your settings in the .htaccess file ? Please can you provide these information as exact as possible. If you don't want to post this here you can PM me. My newly set up testing, without any settings in the .htaccess doesn't recreate any variations. It looks like this:
-
Whats about a #5: $pages->uncache($page) after the $database->commit(); to additionally free some memory.
-
Oh @Robin S, you are right. Sadly the value of $_SERVER['REMOTE_ADDR'] changes between the (remote) browser and the (local) webserver that is used by wirehttp. And if $_SERVER['REMOTE_ADDR'] is part of the session fingerprinting (what it is by default) it only matches if the browser and the webserver are on the same machine. ?
-
I'm not totally following what you are doing, but sessioningerprinting should not be an issue if you look at my code the post above with using php function getallheaders() This allows a complete 1:1 copy of the sended headers from the browser also through wirehttp. It includes the same UA header, same cookies, same everything. array(12) { ["Host"] string(32) "pw-change-default-language.local" ["Connection"] string(10) "keep-alive" ["Upgrade-Insecure-Requests"] string(1) "1" ["User-Agent"] string(132) "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 OPR/75.0.3969.149" ["Accept"] string(135) "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" ["Sec-Fetch-Site"] string(4) "none" ["Sec-Fetch-Mode"] string(8) "navigate" ["Sec-Fetch-User"] string(2) "?1" ["Sec-Fetch-Dest"] string(8) "document" ["Accept-Encoding"] string(17) "gzip, deflate, br" ["Accept-Language"] string(35) "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7" ["Cookie"] string(166) "wire=8jfqut56c2ag66iaquvb27jdpu; wire_challenge=72ie9BYKDjbw4h0%2FhBYu1wmngAyUoA3F; wires=5u0b7v49ecudnj39bmdpat4dje; wires_challenge=TmFvvRVgTxBQYsyta4tST6yQJjkzymPd" }
-
What I have found out is that sending WireHttp requests as https lacks of embedding the ssl certificate things and therefor results in false responses. When I explicitly use http and NOT https, then this code seems to work fine, as it sends exactly the same headers like the browser of the logged in session does: $wire->session->set('wirehttprequestheaders', getallheaders()); $url = 'http://' . $wire->config->httpHost . '/cli.php'; $http = new WireHttp(); foreach($wire->session->get('wirehttprequestheaders') as $header => $value) { if('Host' == $header) continue; $http->setHeader($header, $value); } $response = $http->post($url); // or ->get() or send() if($response !== false) { echo '<pre>'; var_dump($response); } else { echo '<pre>'; var_dump($http->getError()); } My cli.php for testing looks like this: <?php namespace ProcessWire; include('./index.php'); if($wire->user->isSuperuser()) { echo '<pre>'; var_dump(getallheaders()); } else { die('NO ACCESS'); } I never got this timeout behave. Only false or true responses, but always within a second or less. Don't know if this is of any help.
-
Https instead of http? Then it should be wires_challenge with s, not wire_challenge. ?
-
Anything in the server logs? $config->debug on?
-
Hi Adrian, I'm not sure how to do it with wireHttp, means haven't used it until now. But the native header for sending cookies back to the server looks like this: GET /processwire/page/ HTTP/2 Host: www.example.com Cookie: key1=value1; key2=value2 Its a simple key=value pair list separated by semicolons send as a header. Maybe it can be done like this: $http = new WireHttp(); $http->setHeader('Cookie', $cookieList); References: https://tools.ietf.org/html/rfc6265 https://chenhuijing.com/blog/understanding-browser-cookies/
-
I believe the superusers session cookie has to be send with the WireHttp request for that?
-
I think they simply have not! ?
-
@Sanyaissues I see that there is used GD for the creation of the image variations, (at least some). Please, can you tell me which value you use(d) for "defaultGamma" in your $config->imageSizerOptions (or optional a options array passed to the variation creation)? BTW, the image handling is perfect! Different source sets for landscape and portrait orientation, (native) lazy loading, WebP variations with jpeg/png fallback, - everything is in! ? ? If you or the artist is interested in protecting the original images (the high quality 2000px ones) you may embed a .htacess snippet and the admin-image-proxy php from here.
-
[SOLVED] How to add remote images if their filename is an URL parameter
horst replied to rash's topic in General Support
Yep, there are two images added. Why? If you want to rename that one that is named "index.php", you can try to get it by name from the Pageimages object. $img = $page->imgs->get("name=index.php"); // during testing, fisrt check what you have get in $img !! $page->getUnformatted("imgs")->rename($img, 'newbasename.jpg'); $page->save(); If this doesn't work, maybe because php is no valid image extension, you have to get the image files manually from the URL, beautify the file(base)name and add it after that to the images field. -
[SOLVED] How to add remote images if their filename is an URL parameter
horst replied to rash's topic in General Support
@rash, you first must (double)check what you get from $imgs->eq() or any other method. What do you see when you debug it, maybe with var_dump()? You also may try to use $imgs = $page->getUnformatted("imgs"); What objects / values do you get from $page->imgs and from $page->getUnformatted("imgs")? And if you have a multiple based object, how many items are in it, which one is the latest added one? $page->of(FALSE); $page->imgs->add($img_url); $page->save("imgs"); $imgs1 = $page->imgs; $imgs2 = $page->getUnformatted('imgs'); echo "<pre>"; var_dump($imgs2); die(); -
[SOLVED] How to add remote images if their filename is an URL parameter
horst replied to rash's topic in General Support
Have you tried to get the last added item from imgs after you saved the page, use the rename method and maybe save it again? (Don't know if a second save must be done or if it is implizit) $img_url = "https://example.com/index.php?cust=foo&id=1234&filename=d9b88153-89e4.jpg"; $img_basename = "GET-THE-NAME-dot-extension-HERE"; $page->of(FALSE); $page->imgs->add($img_url); $page->save("imgs"); $page->imgs->rename($page->imgs->last(), $img_basename); $page->save("imgs"); // maybe this is not needed ?? Also check that the ->last() item is the one you added before. -
For me it always was enough to remove unwanted entries from the modules table, regardless if the files were removed or still available.
- 1 reply
-
- 1
-
Hi, you may try to copy the complete wire/modules InputfieldFile folder with all files into site/modules InputfieldFile. Then PW should ask you in the admin that there are two modules and which one you want to use. But please better first try this in a backup copy. I used this sometimes in the past, but not with newer PW versions.
-
You are in Flow! ? ?
-
You may have a look to the sort ids. With my old module they initially get setup to 9999999 for the first child. Maybe this is what interferes now. Simply uninstalling the module does not change this. Maybe you temporarily can change the sort order to something different then manually drag/drop, so the tree gets reordered and the sort ids also gets rebuild, (from 0 upcounting instead of the old downcountig from 99999999). And after that, set the sort order back to manually drag/drop.