Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccessible properties with capital letters #1

Closed
tschiemer opened this issue May 14, 2014 · 2 comments
Closed

Inaccessible properties with capital letters #1

tschiemer opened this issue May 14, 2014 · 2 comments

Comments

@tschiemer
Copy link

Hi

Not sure if this applies to all properties, as I'm just testing out the library, but I can not access a startDate property of an event microdata type.

Reproducable as:

$url = 'http://www.residentadvisor.net/events.aspx?ai=174'; // just some random event site
$parser = new \Jkphl\Micrometa($url);
$item = $parser->item('http://data-vocabulary.org/Event');
print_r($item);
var_dump($item->startDate);

Outputs:

Jkphl\Micrometa\Parser\Microdata\Item Object
(
[_url:protected] => Jkphl\Utility\Url Object
    (
        [_url:protected] => http://www.residentadvisor.net/events.aspx?ai=174
        [_parts:protected] => Array
            (
                [scheme] => http
                [host] => www.residentadvisor.net
                [path] => /events.aspx
                [query] => Array
                    (
                        [ai] => 174
                    )

            )

    )

[types] => Array
    (
        [0] => http://data-vocabulary.org/Event
    )

[id] => 
[value] => 
[_properties:protected] => stdClass Object
    (
        [startDate] => Array
            (
                [0] => 2014-05-16T00:00
            )

        [summary] => Array
            (
                [0] => 360 Degrees: Osunlade at Bird
            )

        [url] => Array
            (
                [0] => http://www.residentadvisor.net/event.aspx?569206=
            )

    )

)
NULL

In Jkphl\Micrometa\Item::__get any uppercase characters are exchanged as follows:

`startDate` -> `start-date`

If I remove the responsible line, it works just fine.

Is the property stored correctly as startDate or is it intended to be stored as start-date?

Edit: as for the versions I'm using:

    "mf2/mf2": "dev-master",
    "euskadi31/microdata": "dev-master",
    "jkphl/micrometa": "dev-master",
@jkphl
Copy link
Owner

jkphl commented May 14, 2014

Hi @tschiemer,

thanks for your report! I'm currently on holiday and will be back to my office around end of May. I'll test things then and get back to you. Thanks for your patience!

Cheers,
Joschi

@jkphl
Copy link
Owner

jkphl commented Jun 28, 2014

Hey @tschiemer,

you were right: That line was simply wrong / obsolete, as the microformats2 processing (for which the decamelization was intended) already uses it's own implementation. Deleting the line fixes the issue, I published a new release. Thanks again for reporting!

@jkphl jkphl closed this as completed Jun 28, 2014
jkphl pushed a commit that referenced this issue Mar 15, 2017
Fix problem with "content" not being parsed on non-meta items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants