peterb
Members-
Posts
51 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
peterb's Achievements
Full Member (4/6)
2
Reputation
-
thankyou Diogo, There were 3 functions in LanguageFunctions.php that were the culpret... by wrapping them as you suggested made everthing work again.. thanks.
-
peterb started following Profile Export module (also upgrade PW 2.0 to 2.1) and bootstraping from wordpress in pw 2.2
-
I am in the process of upgrading a processwire site from 2.0 to 2.2, and have found that where I was once able to bootstrap, I am no longer. I am calling processwire from a wordpress install, and this used to work in 2.0 include("./pw/index.php"); // bootstrap ProcessWire $client = $wire->pages->find("template=client, client_email=$email")->first(); now in 2.2 this fails, and I get error like this: [error] PHP Fatal error: Cannot redeclare __() (previously declared in /var/www/vhosts/dev.sitename.com/httpdocs/wp-includes/l10n.php:96) in /var/www/vhosts/sitename.mysite.com/httpdocs/pw/wire/core/LanguageFunctions.php on line 38, referer: http://dev.sitename.com/markets-served/overview/ which seems to colide with a wordpress function: function __( $text, $domain = 'default' ) { return translate( $text, $domain ); } Not really versed enough to go much farther than this... does anyone know a remedy? thanks, Peter
-
Module Profile Export module (also upgrade PW 2.0 to 2.1)
peterb replied to ryan's topic in Modules/Plugins
adding title field solved, thanks... how I made templates without them, I do not know... pb -
Module Profile Export module (also upgrade PW 2.0 to 2.1)
peterb replied to ryan's topic in Modules/Plugins
ok, when I remove "Allowed template(s) for children" and save, the error goes away, but as soon as I re-add it, the error returns... only the top level template has a title field, but I can't delete it, as it says: Field "title" may not be removed because it is globally required by all fieldgroups is there anything else I can flush out or reset? -
Module Profile Export module (also upgrade PW 2.0 to 2.1)
peterb replied to ryan's topic in Modules/Plugins
I thought my upgrade was all set, but I get the following error when I try to add a new page... Error Call to undefined method stdClass::getInputfield() (line 171 of /var/www/vhosts/mysite.com/httpdocs/pw2/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module) -
Module Profile Export module (also upgrade PW 2.0 to 2.1)
peterb replied to ryan's topic in Modules/Plugins
thanks, that seemed to take care of it... at first the email field was not there, just name and roles. then I went to fields, and turned the filter to show built-in fields, and then the email field showed up over in process > users. thankyou! pb -
Does anyone know how to upload a form File threw the api
peterb replied to peterb's topic in API & Templates
indeed, here is the code with validation if(isset($_POST['title'])) { $newpage = new Page(); $newpage->template = $templates->get("upload"); $newpage->parent = $pages->get("/uploader-test/"); $newpage->name = $_POST['title']; $newpage->title = $_POST['title']; $newpage->save(); $path=$newpage->images->path; // GET THE PATH TO THE UPLOADS FOLDER FOR NEW PAGE $name = strtolower($sanitizer->name($_FILES['upload']['name'])); // RUN THE $NAME THROUGH $SANITIZER TO MAKE IT PW COMPATIBLE... // prepend underscores to filename until it's unique... while(is_file($path . $name)) $name = "_" . $name; // validate the file extension $pos = strrpos($name, "."); if(!$pos) throw new WireException("File is missing extension"); $ext = substr($name, $pos+1); if(!in_array($ext, array('pdf', 'jpg', 'jpeg', 'gif', 'png'))) throw new WireException("Invalid extension"); $file = $path . $name; // DETERMINE THE FINAL DESTINATION AND STORE IT IN $FILE if(move_uploaded_file($_FILES['upload']['tmp_name'], $file)) { // MOVE THE FILE TO IT'S DESTINATION USING PHP'S FUNCTION $newpage->report_request->add($file); // ADD IT TO THE PAGE $newpage->save(); // SAVE THE PAGE AGAIN } } -
Does anyone know how to upload a form File threw the api
peterb replied to peterb's topic in API & Templates
thanks.. this seems to work.... if(isset($_POST['title'])) { $newpage = new Page(); $newpage->template = $templates->get("upload"); $newpage->parent = $pages->get("/uploader-test/"); $newpage->name = $_POST['title']; $newpage->title = $_POST['title']; $newpage->save(); $path=$newpage->images->path; // GET THE PATH TO THE UPLOADS FOLDER FOR NEW PAGE $name = strtolower($sanitizer->name($_FILES['upload']['name'])); // RUN THE $NAME THROUGH $SANITIZER TO MAKE IT PW COMPATIBLE... $file = $path . $name; // DETERMINE THE FINAL DESTINATION AND STORE IT IN $FILE if(move_uploaded_file($_FILES['upload']['tmp_name'], $file)) { // MOVE THE FILE TO IT'S DESTINATION USING PHP'S FUNCTION $newpage->report_request->add($file); // ADD IT TO THE PAGE $newpage->save(); // SAVE THE PAGE AGAIN } } -
Module Profile Export module (also upgrade PW 2.0 to 2.1)
peterb replied to ryan's topic in Modules/Plugins
just upgraded from 2.0 to 2.2.. all seems well, except in the admin: 1. the ACCESS -> USERS page produces error: Error Call to a member function get() on a non-object (line 93 of /var/www/vhosts/mysite/pw2/wire/modules/Process/ProcessPageType/ProcessPageType.module) -
I have a site page, outside the admin with a form. The form uploads a file which then needs to be inserted into a pw File field. Is this possible using the processwire api? if(isset($_POST['title'])) { // Process the form echo "processed... <br>"; $newpage = new Page(); $newpage->template = $templates->get("upload"); $newpage->parent = $pages->get("/uploader-test/"); $newpage->name = $_POST['title']; $newpage->title = $_POST['title']; $newpage->save(); $newpage->file->add( $_POST['upload'] ); // this throws an error - [color=#000000][font=Times][size=1]Exception: Item added to Pagefiles is not an allowed type (in httpdocs/pw/wire/core/Array.php line 142)[/size][/font][/color] $newpage->save(); } ?> <h1>Upload file...</h1> <form action="" method="post" enctype="multipart/form-data"> <input name="id" value="<?=$page->id?>" type="hidden"> <table> <tr><td>File:</td> <td><input name="upload" id="upload" type="file"></td></tr> <tr><td>Title:</td> <td><input type="text" name="title"></td></tr> </table> <input type="submit" value="NEXT" class="subbut"> </form>
-
I have an existing pw website that needs some phase 2 additions. Looking for someone versed in processwire to hire & work with. Please contact peter@peterbelsky.com thanks..
-
thanks ryan, yes, I changed it to just assets, and all is good.
-
-
just moved a site to a dedicated server. now when I log in, it goes to the site home page, not the admin home page? nothing I do seems to let me get back to the admin???
-
thankyou, works very well