Jump to content

rushy

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by rushy

  1. Good idea Robin, I will certainly try Tracy Debugger to see if it reports any problem in the backend. My $config is already set true and no visible errors are reported and everything else seems to work fine. Fingers crossed I can find something as I'm fresh out of ideas now...
  2. I tried the above to no avail. I'm really stumped now. Just can't get repeaters to work properly on this server but they are fine on another server. I can't see what the difference is...no errors or warnings. What a pain.
  3. I'm thinking this must be a PHP config. problem on the server. I found a problem with ini_set being disabled for security reasons and thought that would be the problem but now it's enabled the problem persists. See other post: override php.ini It's a long shot, but I think I will reinstall PW from scratch now that I have no server errors - just in case the installation had been affected by the PHP error. I wonder if there is a definitive statement of PHP functions that are required for correct operation of PW? That would help me track down the problem as I have no error messages anywhere now as far as I can see, but images in repeaters still don't work properly on this server. Paul
  4. No, I only have 2 'instances' of the repeater on my page, with 2 fields in the repeater 1 image and 1 TextareaLanguage. The image description field comes with the image.
  5. My problem seems specific to the description text fields provided with images. When used within repeaters, the description field is not saved and original text reappears after save. How can i enable extra logging to track down this problem? I have debug = true in config.php and no messages are seen. Any ideas of where to look? Thanks - Paul
  6. Thanks dragan. I have contacted the host support and they have changed the PHP config. to allow ini_set. The error in the error_log has now gone.
  7. Has anyone come across a shared server where the PHP function ini_set is disabled for security reasons? It seems to break PW correct operation and generate a large error_log. I keep getting guided toward adding lines into the vhost .htaccess but what exactly I should add is unclear. (I tried "php_flag php_admin_value on" and "php_flag php_admin_flag on" to no effect.) As far as I can see I do not have permission to change the php.ini. Anyway if anyone has solved this problem for PW sites on shared server I would be grateful of some help! More info for those that have time to read all about my investigations - I ran into the problem when I copied a site over to a clients shared server. The problem doesn't occur on my localhost or my own shared server, so I know it must be a config. problem on the clients host. The problem seems specific to text fields associated with images within repeaters. I have a repeater defined containing an image and if I change text in the description field and hit save - the text is not saved and original text reappears. This works fine on my local host and my shared host so I guess it something particular to the PHP config on my clients host. I have noticed on the client server there is an error_log in the public_html folder. It contained hundreds of the same error message - namely - [01-Nov-2018 13:49:42 Europe/Berlin] PHP Warning: ini_set() has been disabled for security reasons in /home/rushy/public_html/wire/core/ProcessWire.php on line 190 I don't see this error on the other servers, so guessing this is may an indication of the problem, I decided to try and find out how to re-enable ini_set on a shared server. There is quite a lot out there about this, but I've not found out a way so far. Thanks - Paul
  8. Thanks for the replies. I gave up on the profile export and did it all manually with a db dump as per bernhard suggested and it works fine. Robin S: I note the quote above and I had not fully taken that on board - I think my problems could have been due to not recreating the site user accounts and failure to setup the config.php correctly on the new server. Thanks to you both for helpful suggestions. Paul
  9. I'm trying to migrate a PW site on my local dev server to a shared hosted server and have used the ProcessExportProfile module to export a profile as a zip file. So far so good. I then deploy new install of PW on the server by unzipping the PW installation files but I do not run the install until I have replaced the various site profiles with the files from the exported profile. So basically: In the PW install files I delete all the site-* folders except site-default. This one I overwrite with the export profile folders so it contains my assets, install, modules and templates folders together with the exported config.php I then run the install in the browser in the normal way and it starts the installation and I can see my website profile in the list and I select it. It proceeds as normal and gets to setting up the database. I provide the db info. as usual and it proceeds as far the info. below and 'hangs' at this point , it never goes on to setup the PW login admin. and complete the install I am left at that screen. If I relaunch the browser at the site it all seems to work! BUT I have no admin login to PW so cannot get into the backend. I have basically followed the Installation, Moving and Troubleshooting guide by Joss Sanglier: http://processwire.com/docs/tutorials/installation-moving-and-troubleshooting/page4 Any idea where I could check for an error log or some help as I am at a loss as to the problem. Many thanks. Paul ProcessWire 3.x Installer Test Database and Save Configuration Database connection successful to pinpoin1_master Saved configuration to ./site/config.php Profile Import Imported database file: ./wire/core/install.sql Imported database file: ./site/install/install.sql
  10. Thanks for the heads up. Did you fix the problem? Hosting is provided by the client on a shared server so nothing special there and I don't have access to change anything like mod_security. I am getting an error_log file on the server filling up with "PHP Warning: ini_set() has been disabled for security reasons in /mypath/to/public_html/wire/core/ProcessWire.php on line 190". I don't get this on my localhost. The line at 190 is: ini_set('display_errors', true); so I think this is just to do with error reporting and probably not related to the problem, but I really don't know.
  11. Hi My first use of repeaters. They seem very useful, but I'm having a strange problem with the descriptions of the images field. I can't change them after deploying from my local dev server to the live server. I have defined a repeater with one images field and one textarea (multi language) field. This works as expected when added to a template and on the page I add an image and text in 3 languages. I usually populate the image description fields with a caption text in 3 languages so that I can output a caption if required under the image. Now this all works a treat on my test localhost server, but when deployed to the live site the captions cannot be changed on these repeater image fields. If I login to the live site and change the image text in there - as soon as I hit save the text goes back to what it was before! I am logged in as superuser so can't work out what the problem is. I had a search through the forums but couldn't find a similar problem. Any ideas where to look for some clues to what the problem may be? I'm using ProcessWire 3.0.96 Many thanks - Paul
  12. Hello. I'm making a site based on the multi language example provided at installation and it works well except for the setting of the html lang tag below. This site has Italian as the default so I had to change the language pack following instruction I found on here. It seems to work but the country code below is 'home' when Italian is selected and 'en' when English is selected. <html lang="<?php echo _x('it', 'HTML language code') ?>"> You see I hard wired it for now for the default language. The code below is the language switcher PHP code basically taken from the installation example but with the default set to 'it' not 'home' ! foreach($languages as $language) { if(!$page->viewable($language)) continue; // is page viewable in this language? if($language->id == $user->language->id) { $sel = "<span class='glyphicon glyphicon-ok'></span>"; echo "<li class='current'>"; } else { $sel = ""; echo "<li>"; } $url = $page->localUrl($language); $hreflang = $homepage->getLanguageValue($language, 'name'); if ($language->isDefault()) $hreflang = 'it'; // default is Italian $x = $url.'?lang='.$hreflang; echo "<a hreflang='$hreflang' href='$x'>$sel $language->title</a></li>"; } You can see I added a url param ?lang= to pass the language selected. So in my case 2 links above are created with the lang param appended, and below is the code to extract the params. $q = $input->get('lang'); // retrieve value $q = $sanitizer->text($q); // sanitize input as 1-line text $lang = $sanitizer->entities($q); ?> <!DOCTYPE html> <html lang="<?php echo _x($lang, 'HTML language code') ?>"> <!-- <html lang="<?php echo _x('it', 'HTML language code') ?>"> --> <head> <title><?php echo $title; ?></title> <meta charset="utf-8"> It works, the html lang= is now set correctly but I can't help feeling this is not a good way to do it. Could anyone tell me if this should be necessary? Many thanks! Rushy
  13. Ok thanks for the ideas. Eventually I got it working by using my own pagination buttons - just next & prev. as the PW MarkupPagerNav module did not suit me in my scenario. I just work out what page should be displayed and send a param in my Ajax call so that the body rendering loop in my "webservice" file outputs the correct rows from the table. PW pagination uses the page numbering in the template and the renderPager() renders links that call a template instance with a page no. not what I wanted in this case.... maybe it could work nicely with delayed output - I'm still learning this, but this worked for me - so a big thank you to the above folks who gave me ideas! Paul
  14. Has anyone used pagination with ajax driven content? I'm using the MarkupPagerNav module to give me pagination, but my content is updated by an ajax post to refresh the body content of a table. The pagination links show a myproject/http404/?page=n for each link generated so they give a 404 page not found. I believe this is because the file containing my ajax code resides in the root of my project as a "web service" and does not have the access it needs, but I'm unsure really. If anyone can throw any light on this I would be very grateful. I include the code with my ajax below. <?php namespace ProcessWire; require_once ('./index.php'); // bootstrap ProcessWire if($config->ajax) { $pg = $pages->get("/single-use-carrier-bags/"); $selector = wire('input')->post('selector'); $mytableContent = ''; // hold the table markup // $retailer = $pg->children($selector); // for info. only $selector looks like this -> $retailer = $pg->children("sort=title, include=all, limit=10"); $pageinate = $retailer->renderPager(); echo $pageinate; foreach ($retailer as $r) { $mytableContent .= "<tr> <td><a href= '$r->url' target='_blank'>$r->title</a></td> <td>$r->category</td> <td>".numFormat($r->no_bags_issued)."</td> <td>".numFormat($r->gross_proceeds)."</td> <td>".numFormat($r->net_proceeds)."</td> <td>$r->other_use_net_proceeds</td> <td>".numFormat($r->amount_donated)."</td> <td>$r->good_causes_in_receipt</td> <td>".numFormat($r->no_paper_bags_issued)."</td> <td>".numFormat($r->no_bags_for_life)."</td> </tr>"; } echo $mytableContent; } ?>
  15. Thank you very much for taking the time to do this! That looks just what I need to point me in the right direction, at least I now have some hope I am starting off in the right direction. I will let you know how I get on and if I get stuck on some aspect of this I will probably be bothering you again... ! Regards - Paul
  16. I have a table in my template that I would like to update using Ajax when a button is pressed. I am not sure how to go about this and hope somebody here could point me in the right direction. Here is my code for the table output. You can see I loop through the fields to output using a hard wired selector to list the retailer type. I have a button for Supermarkets that fires a js handler myFunc and I need to put the ajax there to call this page again with a param so I can then form the selector for supermarkets and update the table. When I get this working and understand how to do it in ajax I will code up a selector that is formed dependant on a bank of buttons and the table will update without the rest of the page - like magic! That's what ajax is for right?! Thanks for any help - Paul <button type="button" onclick="myFunc()" value="1" class="btn btn-primary">Supermarkets</button> <div class= "table-responsive"> <table class="table table-hover table-striped"> <thead> <tr> <th>Retailer</th> <th>No. bags issued</th> <th>Gross proceeds £</th> <th>Net proceeds £</th> <th>Other use of net proceeds</th> <th>Amount donated £</th> <th>Good causes in receipt of proceed</th> <th>No. of paper bags issued</th> <th>No. of bags for life</th> </tr> </thead> <tbody> <?php $pg = $pages->get("/single-use-carrier-bags/"); $retailer = $pg->find("category=DIY, sort=title, include=all"); foreach ($retailer as $r) { echo "<tr> <td><a href= '$r->url'>$r->title</a></td> <td>".numFormat($r->no_bags_issued)."</td> <td>".numFormat($r->gross_proceeds)."</td> <td>".numFormat($r->net_proceeds)."</td> <td>$r->other_use_net_proceeds</td> <td>".numFormat($r->amount_donated)."</td> <td>$r->good_causes_in_receipt</td> <td>".numFormat($r->no_paper_bags_issued)."</td> <td>".numFormat($r->no_bags_for_life)."</td> </tr>"; } ?> </tbody> </table> </div> </div> </div> <script type="text/javascript"> function myFunc() { } </script>
  17. Hi bernhard thanks for your help! Great so can I do away with the separate php file completely and do my server mail sending all in my contact file? If so, I can just check if the send was successful or not and display an appropriate message. I'm thinking it would be nice to have a dedicated page after sending the mail with a few other bits of info. on it - if I did want that, how can I invoke another PW page from this point in the contact page? Many thanks - RuShy
  18. Hi. I have a contact page form that collects user queries in the usual manner and when validation is ok it does a method = post with action = contact-form.php to execute the sending of mail from the server. This is all fine and works well, but when the sending is done, I would like a landing page in my project to be displayed. How would i do that? I've tried adding PW code to the contact-form.php to invoke my landing page but I think this is not in scope as nothing happens. Many thanks for any guidance. Paul
  19. Hi Bernhard and also abdus Thanks for your reply guys. I have found the place to enter the image description is when loading the image in the page. The image description field is hidden unless you select the edit mode or 3rd option for thumbnail display as shown below. So I was putting my text in the wrong place. Now it works fine!
  20. Hi I can't retrieve the description field of an image. I follow the example below from the API : http://processwire.com/api/fieldtypes/images/ scroll down to Image Properties heading, below that it says that "Here are all the image properties that are present with every image:" I have created a field of type images, and added it to my template, loaded an image, and in my page it displays fine. I added a description text in the description field and also tried in the template (override option) but it is always blank. Any ideas? I must be missing something simple here? I'm using the latest version of PW. echo "<img src='$image->url' alt='$image->description' />";
  21. Thank you DaveP I searched the forum a bit more and found some similar problems people had encountered and I managed to get it working now! I'm not sure if it was related to the .htaccess you mention, but I changed an entry in my /etc/apache2/apache2.conf file - the AllowOverride was "None" and changing it to "All" and restarting apache has done the trick. I think it allows rewrites to my /var/www folder? Anyway many thanks for your help - let's see if i can make some progress now...! <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
  22. Hello I've got off to a bad start trying to install PW on my local offline server, I must be doing something wrong as I have a bit of experience with Wordpress and it's running fine on my server, but I like the look of PW and hope to try it. Anyway I downloaded and unzipped the PW installation, the installation seemed to go right through ok, everything passed on the check lists. I selected the Default profile, and then when I try to click on Admin access or view the site I get "Not Found - The requested URL /processwire-master/about/ was not found on this server. Apache/2.4.10 (Ubuntu) Server at localhost Port 80" Simply because the /about folder does not exist! It seems the profile has not been installed by the installation process despite everything else being ok? If I type localhost/processwire-master in the browser I get the Minimal Site Profile "What is ProcessWire?" page but the links work "About" & "Site Map" don't work as the folders are not there. Bit confused as to why this is missing. Please put me out of my misery if it's something obvious I am doing / not doing! Many thanks - rushy
×
×
  • Create New...