Jump to content

Marco Ro

Members
  • Posts

    347
  • Joined

  • Last visited

Everything posted by Marco Ro

  1. Yes was true need to add httpUrl. I added an image in this way: "image"=> $_SERVER['HTTP_HOST'].$page->field_image, I test with the google tools and now show me the exact url. In the browser is not visible but I guess we need to wait some days. Thank you!
  2. Hi @wbmnfktr, Thank you for the web tool it's great. I have made the json-dl file and this work well, I can see a reach snipper with valuation, price, availability. There are all the info I put except for the photo. I use the same code I use in the header page->image_card and in the header work well that give me the correct url. But in the schema give me a different url, this one: \/site\/assets\/files\/1059\/nome.jpg . I don't know why, the description work well: $page->Description. Maybe the problem isn't here. How I can show also the photo of the product? Thank you!
  3. hi, thank you @flydev and @Autofahrn I notice that happen this: when for some reason there are long requests something happen, first show me the general error 2006 and that the error to my custom module. I'm not sure it's the module's fault, could be just the first module that try to load? Anyway this is the modulo: CustomHooksForVariations.module - this normally work I already used. About the other post, sorry, I know it's my. I was thinking that conversation was end and was better open one in the modules section. If you want we can make only one or what you think is better.
  4. I can't understand why in the last tow days the website give this error and redirect to error 500. Error: Uncaught Error: Class '\CustomHooksForVariations' not found in /home/stef4341/public_html/wire/core/Modules.php:535 Stack trace: #0 /home/stef4341/public_html/wire/core/Modules.php(1000): ProcessWire\Modules->newModule('\\CustomHooksFor...') #1 /home/stef4341/public_html/wire/core/Modules.php(820): ProcessWire\Modules->loadModule('/home/stef4341/...', '/home/stef4341/...', Array, Array) #2 /home/stef4341/public_html/wire/core/Modules.php(352): ProcessWire\Modules->load('/home/stef4341/...') #3 /home/stef4341/public_html/wire/core/ProcessWire.php(390): ProcessWire\Modules->init() #4 /home/stef4341/public_html/wire/core/ProcessWire.php(209): ProcessWire\ProcessWire->load(Object(ProcessWire\Config)) #5 /home/stef4341/public_html/index.php(52): ProcessWire\ProcessWire->__construct(Object(ProcessWire\Config)) #6 {main} thrown (line 535 of /home/stef4341/public_html/wire/core/Modules.php) At moment to fix this I just delate my custom modules and reload it without changes and everything works well again. But why does this happen? What can I do to solve the problem? I see also these errors I don't know if there are a connection: Error: Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /home/stef4341/public_html/wire/core/WireSaveableItems.php line 168) SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /wire/core/WireCache.php line 440) + line 704 + line 252
  5. Yes, the $UserPwName was not set. This one now work so well!! It's very nice, need just call the variable from json file and match them to the right filed and everything is as popular as it should be! Thank you so mach @Autofahrn! $http = new WireHttp(); d($http); // shows ProcessWire\WireHttp $UserData = json_decode($http->get('localhost:8888/playwood/pw_users.json'), true); d($UserData); foreach($UserData as $v) { // Fetch whatever fields should be imported $UserLoginName = $v["user_login"]; $UserMail = $v["user_email"]; $UserPwName = $v["user_login"]; $UserPwName = $sanitizer->pageName($UserLoginName, true); $usr = $users->get("name={$UserPwName}"); if($usr->id == 0) // User does not exist { $usr = $users->add($UserPwName); // Create user if($usr->id) // Success? { $usr->of(false); // Prepare for update $usr->email = $UserMail; $usr->pad_firstname = $UserLoginName; $usr->CheckBoxPrivacy = true; $usr->subscribe_newsletter = true; $usr->addRole('customer'); $usr->save(); } else { // may $log->error("ERROR creating user {$UserRealName}"); } } }
  6. yes @Autofahrn I have an additional headers. [ {"type":"header","version":"4.7.3","comment":"Export to JSON plugin for PHPMyAdmin"}, {"type":"database","name":"stef4341_playwood"}, {"type":"table","name":"name_users","database":"nome_data","data": [ {... row ...} {... row ...} ] } ] In this case what I need use? Anyway i try just to delate the header and keep only the data in [ {data} {data} ] This more or less work! give me this error: ERROR: Maximum execution time of 30 seconds exceeded on line: 1587 in /Applications/MAMP/htdocs/playwood/wire/core/Page.php But I think if I split the data in tow file I will fix it. The second thing is that yes make the users in users page with the correct rules, but not take me the correct data, instead of taking me $v["user_login"] and $v["user_email"] but make all the name with the day and hour when it's created. This is all the file $http = new WireHttp(); d($http); // shows ProcessWire\WireHttp $UserData = json_decode($http->get('localhost:8888/playwood/pw_users.json'), true); d($UserData); foreach($UserData as $v) { // Fetch whatever fields should be imported $UserLoginName = $v["user_login"]; $UserMail = $v["user_email"]; $UserPwName = $sanitizer->pageName($UserLoginName, true); $usr = $users->get("name={$UserPwName}"); $pw = new Password(); $pw = $pw->randomPass([ 'minLength' => 10, 'maxLength' => 10, 'maxSymbols' => -1, 'minUpper' => 0, 'maxUpper' => -1, ]); if($usr->id == 0) // User does not exist { $usr = $users->add($UserPwName); // Create user if($usr->id) // Success? { $usr->of(false); // Prepare for update $usr->email = $UserMail; $usr->pad_firstname = $UserLoginName; $user->pass = $pw; $usr->CheckBoxPrivacy = true; $usr->subscribe_newsletter = true; $usr->addRole('customer'); $usr->save(); } else { // may $log->error("ERROR creating user {$UserRealName}"); } } }
  7. This could be the problem? Before The module was write in this way: <?php class CustomHooksForVariations extends WireData implements Module { after I change in <?php class CustomHooksForVariations extends WireData implements Module { Cloud be this? I just make this change reinstall the module and now work. Anyway it was a month that the module was online and always worked well. Thank you for your help.
  8. yes there are a lot of things that are to advance for me, so I not really know what I do! yes now the file is recognized! the problem is that not take the data because tell me the Error: Undefined index: user_login on line: 8 and line 9 that are $UserLoginName = $v["user_login"]; $UserMail = $v["user_email"]; Could be the problem came for the json file. This is an example of a row: {"ID":"1","user_login":"myname","user_pass":"$P$BKVS\/30bpzejiORa9nGupsAur7g0P\/","user_nicename":"mynicename","user_email":"email@email.it","user_url":"","user_registered":"2016-07-28 16:13:39","user_activation_key":"","user_status":"0","display_name":"myname"}, This is all the code: $http = new WireHttp(); d($http); // shows ProcessWire\WireHttp $UserData = json_decode($http->get('localhost:8888/playwood/pw_users.json'), true); d($UserData); foreach($UserData as $v) { // Fetch whatever fields should be imported $UserLoginName = $v["user_login"]; $UserMail = $v["user_email"]; $UserPwName = $sanitizer->pageName($UserLoginName, true); $usr = $users->get("name={$UserPwName}"); if($usr->id == 0) // User does not exist { $usr = $users->add($UserPwName); // Create user if($usr->id) // Success? { $usr->of(false); // Prepare for update $usr->email = $UserMail; $usr->pad_name = $UserLoginName; $usr->addRole('customer'); $usr->save(); } else { // may $log->error("ERROR creating user {$UserRealName}"); } } } If I can do let this work I promise not to bore you again! load users one by one ...
  9. Hi, This morning something strange happened, I not was working on the website but the console log show me this Error: Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /home/stef4341/public_html/wire/core/Modules.php line 3035) immediately after stat to show me 1000 time this other error: and the site goes on error 500 Error: Uncaught Error: Class '\CustomHooksForVariations' not found in /home/stef4341/public_html/wire/core/Modules.php:535 Stack trace: #0 /home/stef4341/public_html/wire/core/Modules.php(1000): ProcessWire\Modules->newModule('\\CustomHooksFor...') #1 /home/stef4341/public_html/wire/core/Modules.php(820): ProcessWire\Modules->loadModule('/home/stef4341/...', '/home/stef4341/...', Array, Array) #2 /home/stef4341/public_html/wire/core/Modules.php(352): ProcessWire\Modules->load('/home/stef4341/...') #3 /home/stef4341/public_html/wire/core/ProcessWire.php(390): ProcessWire\Modules->init() #4 /home/stef4341/public_html/wire/core/ProcessWire.php(209): ProcessWire\ProcessWire->load(Object(ProcessWire\Config)) #5 /home/stef4341/public_html/index.php(52): ProcessWire\ProcessWire->__construct(Object(ProcessWire\Config)) #6 {main} thrown (line 535 of /home/stef4341/public_html/wire/core/Modules.php) Only if I delate the module the error disappears and the site becomes visible again. After I have delate also the module in the FileCompiler and reinsert the module in the right palace refresh the Modules in the backend and now all work. but: Some one can tell me what happen? and how can I prevent these errors? Thank you
  10. Thank you @Autofahrn and @bernhard for your help! I was write you just new! I don't know what mean besserwisserisch but sure you are so welcome!! so, this is what I was writing, but now I will study your code and try to use it!! A few things: I used Tracy Console but I think this is wrong, How can set where thank the file? $UserData = json_decode($http->get('localhost:8888/playwood/pw_users.json'), true); For the password if i take the one is in the file, the encrypted password, this will work? or I have anyway to setup a new one? I think to have make some more error but I can not understand where, the filed are the right. <?php namespace ProcessWire; if(isset($page->json_file)) $UserData = json_decode($http->get('localhost:8888/playwood/pw_users.json'), true); else $UserData = [ ]; // ensure always set, yet empty. foreach($UserData as $v) { // Fetch whatever fields should be imported $UserLoginName = $v["user_nicename"]; $UserMail = $v["user_email"]; $UserPwName = $sanitizer->pageName($UserLoginName, true); $usr = $users->get("name={$UserPwName}"); if($usr->id == 0) // User does not exist { $usr = $users->add($UserPwName); // Create user if($usr->id) // Success? { $usr->of(false); // Prepare for update $usr->email = $UserMail; $usr->pad_name = $UserLoginName; $usr->addRole('customer'); $usr->save(); } else { // may $log->error("ERROR creating user {$UserRealName}"); } } in the debug i see only: Exception: syntax error, unexpected end of file on line: 31 also, can I run all the process directly inside the Tracy Console?
  11. Thank you @Sergio I have the wordpress database, I can use xml, json or any other export from SQL database. I have to import all the user. I use LoginRegister module that write the data in different tables, depends on the field used. But I don't have idea how do this. I read the article and yes Ryan do something to similar, but honestly I'm not able to do such a thing. --- @adrian thank you, at moment I don't have the wordpress installation, I will try to make a copy in local and try to export the new xml file. I try with ProcessMigrator but the xml form the just database not work.
  12. Marco Ro

    So happy :)

    I'd like a lot to have a teacher ?, learning alone sometimes it is very stressful!! Anyway, I take this opportunity to say really thank all of you members of the forum that you helped me so much! specially you @flydev that help me a lot with the login/registration module!! surely you will be a good teacher!
  13. Thank you @pwired, I try to use this module, I have made the Json file try to upload but give me this error, Anyway I don't think can work. because this module don't ask me where I want store the data. -------- I think something like the modulo http://modules.processwire.com/modules/import-pages-xml/ of @justb3a could work. The only problem it's this fill the template, and the registration filed aren't in a template but inside a module. I can not connect the xml file to the field for let go the info in the right database tables.
  14. Hi, Someone has an idea of how to import the user database for wordpress to pw? I see the pw database don't have the same structure of wp database. Of course and i'm happy about this, the pw database is big 10 time sell and work better! But about import the user data, some one have an idea? I use LoginRegister module by @flydev (hi flydev).The worpdress data use this structure: INSERT INTO `pw_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES I see in the pw all the data are split in different tables. Is there an away to import the data or I have to make the profile one by one in the backend? Maybe I can use http://modules.processwire.com/modules/import-pages-xml/ but not really sure how to use it. Thank you!
  15. For me I thing was something different I was doing a test to the checkout page, I was log-in with one name but enter by hand other data to fill the form. Maybe could be this that have make a error. honestly this maybe doesn't make much sense but I don't know what else could have triggered the error.
  16. Hi guys, What mean this error? and when show up? This request was aborted because it appears to be forged. (in /wire/core/SessionCSRF.php line 190)
  17. Thank you @flydev! is it right do this: if($input->post->customerForm) { // It's the button ID, right? //instantiate variables taking in the form data // set other profile var... $invoice_CF = $sanitizer->text($input->post->Inputfield_invoice_CF); // update user details $user->of(false); $user->Inputfield_profile_invoice_CF = $invoice_CF; // is it correct? or use the field name? $user->save(); $user->of(true); } but, can I serialize all the data using the from ID and then update the user filed? or I need set all the variables ? (are not a lot I can do...) I see an error like this: at line // update user details syntax error, unexpected ' ' (T_STRING)
  18. Hi @flydev, Is it possible update the user data form other form? I mean, user make the registration with one form, that in the website there are other interaction, like the checkout form, is it possible with this checkout form integrate or update the user information ? So, I think first I need add all the field in the user page, in the way there are a place for put the data, but for to populate these fields how I do?
  19. Thank you @FrancisChung Yes I have also write in the specific forum, but it isn't as busy as this. Do you think for a checkout page is better disable the file compiler ? could be this to generate this error? You are right about the hosted, thank you.
  20. Hi guys, I use Padloper (it's a great tools) but I can't understand why some time give me this error: Error: Exception: Error Processing Request (in /home/stef4341/public_html/site/modules/PadCart/PadOnePageCheckout.module line 42) #0 /home/stef4341/public_html/site/assets/cache/FileCompiler/site/templates/checkout.php(9): ProcessWire\PadOnePageCheckout->render() #1 /home/stef4341/public_html/wire/core/TemplateFile.php(287): require('/home/stef4341/...') #2 /home/stef4341/public_html/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #3 /home/stef4341/public_html/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___render', Array) #4 /home/stef4341/public_html/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #5 /home/stef4341/public_html/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #6 /home/stef4341/public_html/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #7 /home/stef4341/public_html/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___rende This does not always happen but sometimes, but it's a big problem because when happen I can't take the payment. I didn't make hook or particular changes. What does this message mean? What is it stef4341? Could be a good Idea disable the file compiler for the checkout page? One my customer send me this:
  21. ok, I solved the problems this this way: About the database link, I have open it and clean all the text with the wrong text just by find and replace with a empty filed. About the link in the backend menu I have clean the cache multiple time, but only if I close the browser and restart the pc the link start to works. So, the problem was in the cache but was a bit strange have had to restart the pc.
  22. Thank you very much @flydev 

    Do you need the accesse to the backend or ftp?

  23. it's like yours # RewriteBase / # RewriteBase /pw/ # RewriteBase /~user/
  24. Thank you @flydev but it's not this. it's very strange that the links have not changed only to the superadmin.
  25. Thank you @dragan for the reapply. I try to do it, I have clean all cache and also the /assets/cache/ folder. I have in the dabatabe clean all the wrong extension with find and replace. But in the backend the main navigation links do not work still point to a wrong url. But the page inside work well. Like I can make some change to the module configuration. Where I can fix this? UPDATE This is valid only for the Super Admin, other users have the correct link
×
×
  • Create New...