tag:blogger.com,1999:blog-5023448542823447711.comments2023-09-22T04:05:16.253-07:00Optimizely Module: Notes on Converting to Drupal 8Earl Fonghttp://www.blogger.com/profile/05682372868411855409noreply@blogger.comBlogger86125tag:blogger.com,1999:blog-5023448542823447711.post-69754686180678254882016-01-30T22:31:50.580-08:002016-01-30T22:31:50.580-08:00Thaaaaaaaaaaaaaaanks <3Thaaaaaaaaaaaaaaanks <3IuriMattoshttps://www.blogger.com/profile/00965516740672356670noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-65045304149178990872016-01-19T08:10:33.974-08:002016-01-19T08:10:33.974-08:00That's a good idea to look into adding error h...That's a good idea to look into adding error handling to the JS code for the Optimizely module.Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-72314786072813613082016-01-19T07:50:49.038-08:002016-01-19T07:50:49.038-08:00Super helpful! Perhaps the error handling could be...Super helpful! Perhaps the error handling could be added to the module?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-58096271181554240612015-12-29T06:42:19.103-08:002015-12-29T06:42:19.103-08:00Update on my previous post:
SOLVED.
The schemafile...Update on my previous post:<br />SOLVED.<br />The schemafile should be as below.<br />so there has to be a mapping for langcode and one for <br />loremipsum<br /><br />loremipsum.settings:<br /> type: mapping<br /> label: 'Lorem Ipsum settings'<br /> mapping:<br /> langcode:<br /> type: string<br /> label: 'Language code'<br /> loremipsum:<br /> type: mapping<br /> mapping:<br /> page_title:<br /> type: text<br /> label: 'Lorem ipsum generator page title:'<br /> source_text:<br /> type: text<br /> label: 'Source text for lorem ipsum generation:'<br />block.settings.loremipsum_block:<br /> type: block_settings<br /> label: 'Lorem ipsum block'<br /> mapping:<br /> loremipsum_block_settings:Jhmnieuwenhuishttps://www.blogger.com/profile/15263673348802290798noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-21913059837194467282015-12-29T02:35:03.003-08:002015-12-29T02:35:03.003-08:00Thanks for the info. I also saw this.
But in my co...Thanks for the info. I also saw this.<br />But in my code i used the correct entries, but still the code inspector gives the error:<br />'loremipsum.settings:langcode' => 'missing schema'<br /><br />Any ideas on what I am missing ?????<br /><br />My schema file :<br />================<br /><br />loremipsum.settings:<br /> type: mapping<br /> label: 'Lorem Ipsum settings'<br /> mapping:<br /> loremipsum:<br /> type: mapping<br /> mapping:<br /> page_title:<br /> type: text<br /> label: 'Lorem ipsum generator page title:'<br /> source_text:<br /> type: text<br /> label: 'Source text for lorem ipsum generation:'<br /> langcode:<br /> type: text<br /> label: 'Language code:'<br /><br /><br />My settings file:<br />=================<br /><br />loremipsum:<br /> page_title: 'Lorem ipsum'<br /> source_text: "Lorem ipsum dolor sit amet"<br /> langcode: 'en'<br />Jhmnieuwenhuishttps://www.blogger.com/profile/15263673348802290798noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-6505105879422420512015-12-14T06:56:44.827-08:002015-12-14T06:56:44.827-08:00Interesting! This seems to be at the root of the l...Interesting! This seems to be at the root of the localization efforts in D8. I'd love to more of your thoughts on this as it seems like an important issue for any schema design where language has become a basic consideration.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-81329274700722786162015-11-14T07:27:51.535-08:002015-11-14T07:27:51.535-08:00Cool! print_r() followed by exit() does write its...Cool! print_r() followed by exit() does write its output to the page with nothing else after it. Good to know about this use of exit().Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-79777141248287168502015-11-13T17:46:42.004-08:002015-11-13T17:46:42.004-08:00Thus the "exit()" in:
echo '< pr...Thus the "exit()" in:<br /><br />echo '< pre >';<br />print_r($some_var);<br />echo('< /pre >);<br />exit;Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-43702287649456135962015-11-13T17:40:21.259-08:002015-11-13T17:40:21.259-08:00@Dee Unfortunately, for the particular use case o...@Dee Unfortunately, for the particular use case of code that is evaluated for the purpose of determining the visibility of a block, the output from dsm()/dpm() disappears into the ether.<br /><br />Although not ideal, watchdog() writes to the system log and does work for this situation.<br /><br />Normally, I'd use a debugger. But I'm pretty skeptical it would kick in for code that is evaluated in this manner.<br />Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-70875589501036615852015-11-13T16:47:36.561-08:002015-11-13T16:47:36.561-08:00That's a great point about using isset().
Whe...That's a great point about using isset().<br /><br />When I first read that, I thought it would still trigger a PHP warning since the parameter to isset() looks like an expression that needs to be evaluated.<br /><br />Not so! isset() is a language construct, not a function call. Its param can only be a variable.<br /><br />When I used isset() as Dee described, it also eliminated the warnings. Very nice, and it's a more robust approach since the param indexes all the way down to the actual variable of interest.Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-6399935101971279072015-11-11T08:06:52.896-08:002015-11-11T08:06:52.896-08:00A few points perhaps of value:
- isset() rather th...A few points perhaps of value:<br />- isset() rather than !empty() is the "standard" in the Drupal PHP community. For example:<br /><br />if (isset($current_slam['und'][0]['target_id'])) { <br /> $slam_id = $current_slam['und'][0]['target_id']; <br />}<br /><br />- print_r is the "old school" way of getting debugging output from Drupal:<br /><br />echo '< pre >';<br />print_r($some_var);<br />echo('< /pre >);<br />exit;<br /><br />The devel module's dsm() gives you the same kind of debugging output.<br /><br />I hope these are of value.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-6396671025469003532015-10-01T04:44:05.016-07:002015-10-01T04:44:05.016-07:00Thank you so much for sharing this one really Good...Thank you so much for sharing this one really Good topic Professional SEO all Kind of peaceful info,Love it- <a href="http://www.letsnurture.com/services/twilio-api-integration-service-for-webmobile.html" rel="nofollow">Twilio API Integration</a>Anonymoushttps://www.blogger.com/profile/02761991201795341398noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-13030507736322682242015-09-29T02:01:34.778-07:002015-09-29T02:01:34.778-07:00Drupal Version : 8.0.x-dev - 2015-Sep-29 - ...Drupal Version : 8.0.x-dev - 2015-Sep-29 - Development version<br />Drush Version : 7.0-dev<br />PHP Version : PHP 5.6.10<br />Still getting Error :<br /><br />Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in Drupal::getContainer() (line 129 of /Applications/MAMP/htdocs/drupal-8.0.x-dev/core/lib/Drupal.php).<br />Drush command terminated abnormally due to an unrecoverable error.ImagoTechStackhttps://www.blogger.com/profile/01156873726060051452noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-3027113486539113442015-09-21T11:49:22.729-07:002015-09-21T11:49:22.729-07:00Here is very informative article about configuring...Here is very informative article about configuring apache virtual host on RHEL or CentOS.<br />http://www.sysadminshowto.com/configure-ip-based-apache-virtual-host-rhel-6-x-centos-6-x/fikret tursakhttps://www.blogger.com/profile/08829566380860021812noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-2049966711401146122015-08-25T08:51:53.270-07:002015-08-25T08:51:53.270-07:00Perhaps a reference that might help: https://www.d...Perhaps a reference that might help: https://www.drupal.org/node/2092643Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-60396186423954435322015-08-15T14:42:10.358-07:002015-08-15T14:42:10.358-07:00As you suggest "The difficulty lay in getting...As you suggest "The difficulty lay in getting to the log in the first place". Perhaps add some notes on your process in finding the logs?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-2032529060839104372015-06-14T11:51:22.288-07:002015-06-14T11:51:22.288-07:00That looks like another great book recommendation ...That looks like another great book recommendation from you. I'm looking forward to having it help me expand and clarify my understanding of scope and closures in JavaScript.Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-45825088006834737582015-06-14T08:23:55.707-07:002015-06-14T08:23:55.707-07:00I've found this to be a great resources to exp...I've found this to be a great resources to explore "closures" further: http://www.amazon.com/You-Dont-Know-JS-Closures/dp/1449335586Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-55534552034530939482015-04-07T09:37:19.269-07:002015-04-07T09:37:19.269-07:00I think the conceptual overview provided by this a...I think the conceptual overview provided by this article applies just as well to D8.<br /><br />However, the actual implementations between D7 and D8 sound wildly different. See, for example, "Entity API in Drupal 8", https://www.drupal.org/developing/api/entity<br />Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-9484988186509321302015-04-07T08:49:49.130-07:002015-04-07T08:49:49.130-07:00Have you found something similar in a Drupal 8 con...Have you found something similar in a Drupal 8 context?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-37303748585686015012015-03-08T20:22:34.283-07:002015-03-08T20:22:34.283-07:00The article on foreach at the url you provided sho...The article on foreach at the url you provided shows how there are a lot of complications that can arise when using references in conjunction with this looping construct.<br /><br />The particular comment by Delian Krustev proved extremely helpful. It explains how at the end of the first loop, the variable remains a reference to the last array element. In the second loop, the variable continues to refer only to the _last_ element. So as the second loop executes, array values are in turn assigned to the last element, with the final result that the last element ends up having the value of the next-to-last element. <br /><br />That was exactly the understanding I was hoping to get. Thanks!!<br />Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-19356939971723649952015-03-08T19:47:22.346-07:002015-03-08T19:47:22.346-07:00Do a search for "PHP foreach internal array p...Do a search for "PHP foreach internal array pointer". And / or "internal array pointer" http://php.net/manual/en/control-structures.foreach.php.<br /><br />Not sure if this is related but perhaps of value?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-41176871662152290922015-02-15T07:41:09.264-08:002015-02-15T07:41:09.264-08:00Perfect.. :)Perfect.. :)Paulhttp://www.highspec-computers.co.uknoreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-12842168130867505742015-01-19T15:15:25.011-08:002015-01-19T15:15:25.011-08:00Yes, I'm new to working in Linux and am defini...Yes, I'm new to working in Linux and am definitely getting the impression that su root is considered bad practice. You make a very good point about security, not to mention the increased potential for unintentionally mucking things up in a serious way.Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-58387354889285426612015-01-19T14:53:01.960-08:002015-01-19T14:53:01.960-08:00Why "su root" rather than "sudo&quo...Why "su root" rather than "sudo"? I've found using sudo with a user account forces me to understand when extra privileges are need to perform a task. Using "su root" seems dangerous as you're assuming maximum privileges with little regard for the specifics of the security you're overriding. I've even heard the argument that the root account should be disabled.<br /><br />Just a thought with little sys admin experience to back it up :)Anonymousnoreply@blogger.com