Jump to content

LLLLLLL

Members
  • Posts

    306
  • Joined

  • Last visited

Posts posted by LLLLLLL

  1. class foo {
      // was this always allowed?
      public $bar = 'abc default value';
    
      // or did older versions only allow this?
      public $bar;
    }
    

    I couldn't determine the answer to this question looking at documentation. I found some old code where no class had a default value. Maybe it was a developer preference, but I was wondering if older PHP versions didn't even allow default values?

     

    Just a question of curiosity. 

  2. I'm getting "Uncaught SyntaxError: Unexpected end of input" (VM4193:1) on this AJAX call:

      MakeRequest : function( blah, blah ) {
        
        $.post( blah-blah-url,
          obj,
          function( data ) {
    
          var result = null;
          try {							
          	result = JSON.parse( data );
          } catch (err) {
    
          }
    
          SOMETHING.HandleResult( result );
        })
        .fail( function() {
    
        });
      },
    

    ... the odd thing is, I get this error in Chrome before anything has actually happened in the result. What I mean is: when I put the breakpoint on result=null, the error happens right there. The parse() function has no error, so... what on earth is going on?

     

    I'm not sure how to be any more clear on this or what to add. It's quite standard stuff. The JSON blob that's returned is obviously valid... so I wonder where that error is coming from?

  3. This seems like something I've done several times a year for years, but I can't seem to get it. I can't find a solution on Google that works, although the question was asked many times and answered, too. Also, I'm low on sleep right now.

     

    Let's say I have two tables:

    USERS

    USERS_LOGINS

     

    I want to join the tables and get one row per user, with only the latest login row. Assume "UserId" is the pk/fk and there's some sort of LoginTime in the USERS_LOGINS table.

     

    So I will get results like:

    - Brian  8/4

    - Mitch 8/3

    - Jerry 8/2

     

    I appreciate the help.

  4. There are lots of discussions about this topic online. My issue wasn't subdomain sessions being recognized by the primary domain (and vice versa), but rather just a subdomain handling things at all. You set something in the subdomain, refresh the page, and then the thing was unset.

     

    Here's what I currently have:

    session_name( "blah" );
    ini_set( "session.cookie_domain", '.dev.example.com' );
    session_set_cookie_params( 0, '/', '.dev.example.com', true, true );
    setcookie( session_name(), session_id(), 0, '/' , '.example.com' );
    session_start();

    Things that were required, apparently:

    1) Session name

    2) setcookie

     

    Now with this setup, I can do this:

    start session in dev.example.com, access it in subsub.dev.example.com, go back and forth... session holds as expected.

     

    But what I cannot do, is:

    start session in subsub.dev.example.com, refresh page, have the session data hold.

     

    So lots of questions. 

    1. Obviously the most important: why doesn't a session hold when I start the session in the subsub domain?
    2. Why is a session name required? (Is it?)
    3. Why is setcookie required when all I want to do is start a session? (Is it?) I don't use this step if it's a single-domain type of setup.
  5. I'm not sure why you emphasize nearly, as if there is a lot of positioning on the page. There isn't. The relative div was added for the purposes of the text in the upper-right of that purple box (favorites of 2016), but that's the only positioning on the page.

     

    I can rework how that text gets to that spot... but my question still isn't answered. Any z-index added to the search results doesn't make it appear above the relative-positioned purple box. So the answer still isn't clear.

  6. Check out http://mainlypiano.com/ and start typing in the search box ("dav" will get you several results).

     

    Notice that the search box goes below the middle light purple box. There's no z-index here to cause an issue. If one removes the relative position of the light purple box, the search results menu shows in its entirety. That's weird, isn't it? (That messes up the "favorite albums" text there, which is the point of the relative position, but lets you see the error.)

     

    Any idea why this is happening?

     

     

  7. I have a trigger, 

     

    CREATE TRIGGER `TRIGGER_SOMETABLE_UID` BEFORE INSERT ON `SOMETABLE`
     FOR EACH ROW SET NEW.Uid = UUID(  )
     
    Now, I thought this would fire FOR EACH ROW, but if I'm doing an insert like this...
     
    insert into sometable ( col1, col2 )
    ( select col1, col2 from SOME_OTHER_tABLE )
     
    ... and that inserts two rows, the result is that Uid in both new rows is identical. This is not the desired behavior. Can you tell me how to get a unique Uid in each row?
  8. Yes, it seems the goal was to write "clever" code instead of something that just works. It's likely we won't be using them long-term, but for now I'd love to figure out why I can't even reach the /setup folder to do anything. My error is the same that hundreds of others have reported.... as with most freeware carts, there are no solutions to be found on the interwebs. "Free carts aren't free."

  9. The class ends up being Magento\Backend\Model\Auth\Session\Interceptor, which isn't a class that exists. I assume it gets created on the fly? Seriously, there are 48,000 Magento files; the software is more bloat than I've ever seen.

     

    I'll look into XDebug, I guess.

  10. I've been given an unfortunate task of working with magento. My question might be magento-specific, but I'm not sure that it is. In short, I'm troubleshooting something and confused. This code...

     

    $user = $this->getUser();

     

    ...would seem to be quite easy to troubleshoot, but it is not. The current class has no getUser function. Its base class has no getUser function. If I print a debug statement to examine $this, the class I'm looking at -- Session -- isn't the class at all!  $this is some other class! In fact, the class that is shown doesn't exist anywhere in the source code.

     

    So... what the heck? How can $this not be $this ??

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.